Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/update-rustledger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Update Rustledger WASM

on:
repository_dispatch:
types: [rustledger-release]
workflow_dispatch:
inputs:
version:
description: 'Rustledger version (e.g., v0.8.5)'
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
update-wasm-version:
name: Update WASM version
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}

- name: Get version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${{ github.event.client_payload.version }}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Using rustledger version: $VERSION"

- name: Update RUSTLEDGER_VERSION in engine.py
run: |
VERSION="${{ steps.version.outputs.version }}"
FILE="src/rustfava/rustledger/engine.py"

# Update the version
sed -i "s/RUSTLEDGER_VERSION = \"v[0-9]*\.[0-9]*\.[0-9]*\"/RUSTLEDGER_VERSION = \"$VERSION\"/" "$FILE"

# Verify the change
grep "RUSTLEDGER_VERSION" "$FILE"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.app-token.outputs.token }}
base: main
commit-message: "chore: upgrade rustledger to ${{ steps.version.outputs.version }}"
title: "chore: upgrade rustledger to ${{ steps.version.outputs.version }}"
body: |
Automated update of rustledger WASM version to ${{ steps.version.outputs.version }}.

This PR was triggered by a new rustledger release.

See [rustledger releases](https://github.com/rustledger/rustledger/releases) for changelog.
branch: chore/upgrade-rustledger-${{ steps.version.outputs.version }}
delete-branch: true
2 changes: 1 addition & 1 deletion src/rustfava/rustledger/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
SUPPORTED_API_VERSION = "1."

# Rustledger release to download
RUSTLEDGER_VERSION = "v0.7.0"
RUSTLEDGER_VERSION = "v0.8.5"
RUSTLEDGER_WASM_URL = (
f"https://github.com/rustledger/rustledger/releases/download/"
f"{RUSTLEDGER_VERSION}/rustledger-ffi-wasi-{RUSTLEDGER_VERSION}.wasm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"account":"Assets:Cash","booking":"STRICT","currencies":["USD"],"date":"2017-12-11","entry_hash":"ENTRY_HASH","meta":{},"t":"Open"},{"account":"Assets:Cash","amount":{"currency":"USD","number":"1"},"date":"2017-12-13","diff_amount":null,"entry_hash":"ENTRY_HASH","meta":{},"t":"Balance","tolerance":null},{"account":"Assets:Cash","amount":{"currency":"USD","number":"1"},"date":"2017-12-14","diff_amount":null,"entry_hash":"ENTRY_HASH","meta":{},"t":"Balance","tolerance":null},{"account":"Assets:Cash","date":"2017-12-16","entry_hash":"ENTRY_HASH","filename":"./tests/data/filename","links":[],"meta":{},"t":"Document","tags":[]},{"date":"2017-12-12","description":"event description","entry_hash":"ENTRY_HASH","meta":{"account-value":"Assets:Cash","amount-value":{"currency":"USD","number":"10"},"bool-value":true,"currency-value":"USD","date-value":"2022-12-12","number-value":"20","string-value":"value"},"t":"Event","type":"event name"},{"account":"Assets:Cash","comment":"This is some comment or note","date":"2017-12-20","entry_hash":"ENTRY_HASH","links":[],"meta":{},"t":"Note","tags":[]},{"account":"Assets:Cash","date":"2017-12-21","entry_hash":"ENTRY_HASH","meta":{},"source_account":"Assets:OtherCash","t":"Pad"},{"account":"Assets:Cash","date":"2017-12-22","entry_hash":"ENTRY_HASH","meta":{},"t":"Close"},{"currency":"USD","date":"2018-12-15","entry_hash":"ENTRY_HASH","meta":{},"t":"Commodity"},{"amount":{"currency":"EUR","number":"1"},"currency":"USD","date":"2018-12-16","entry_hash":"ENTRY_HASH","meta":{},"t":"Price"},{"date":"2012-12-12","entry_hash":"ENTRY_HASH","meta":{},"t":"Custom","type":"string","values":[{"currency":"EUR","number":1.0},false]},{"date":"2019-12-12","entry_hash":"ENTRY_HASH","meta":{},"name":"query name","query_string":"journal","t":"Query"}]
[{"account":"Assets:Cash","booking":"STRICT","currencies":["USD"],"date":"2017-12-11","entry_hash":"ENTRY_HASH","meta":{},"t":"Open"},{"account":"Assets:Cash","amount":{"currency":"USD","number":"1"},"date":"2017-12-13","diff_amount":null,"entry_hash":"ENTRY_HASH","meta":{},"t":"Balance","tolerance":null},{"account":"Assets:Cash","amount":{"currency":"USD","number":"1"},"date":"2017-12-14","diff_amount":null,"entry_hash":"ENTRY_HASH","meta":{},"t":"Balance","tolerance":1.0},{"account":"Assets:Cash","date":"2017-12-16","entry_hash":"ENTRY_HASH","filename":"./tests/data/filename","links":[],"meta":{},"t":"Document","tags":[]},{"date":"2017-12-12","description":"event description","entry_hash":"ENTRY_HASH","meta":{"account-value":"Assets:Cash","amount-value":{"currency":"USD","number":"10"},"bool-value":true,"currency-value":"USD","date-value":"2022-12-12","number-value":"20","string-value":"value"},"t":"Event","type":"event name"},{"account":"Assets:Cash","comment":"This is some comment or note","date":"2017-12-20","entry_hash":"ENTRY_HASH","links":[],"meta":{},"t":"Note","tags":[]},{"account":"Assets:Cash","date":"2017-12-21","entry_hash":"ENTRY_HASH","meta":{},"source_account":"Assets:OtherCash","t":"Pad"},{"account":"Assets:Cash","date":"2017-12-22","entry_hash":"ENTRY_HASH","meta":{},"t":"Close"},{"currency":"USD","date":"2018-12-15","entry_hash":"ENTRY_HASH","meta":{},"t":"Commodity"},{"amount":{"currency":"EUR","number":"1"},"currency":"USD","date":"2018-12-16","entry_hash":"ENTRY_HASH","meta":{},"t":"Price"},{"date":"2012-12-12","entry_hash":"ENTRY_HASH","meta":{},"t":"Custom","type":"string","values":[{"currency":"EUR","number":1.0},false]},{"date":"2019-12-12","entry_hash":"ENTRY_HASH","meta":{},"name":"query name","query_string":"journal","t":"Query"}]
Loading