Skip to content

Commit

Permalink
Adding version sync action
Browse files Browse the repository at this point in the history
  • Loading branch information
Slad3 committed Nov 27, 2024
1 parent 1d5b888 commit 3fc3f69
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/version-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Update Version

on:
push:
paths:
- '.version' # Trigger when the .version file is updated

jobs:
update-version:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Read version from .version
id: read_version
run: echo "VERSION=$(cat .version)" >> $GITHUB_ENV

- name: Update fitl-js/package.json
run: |
jq ".version = \"$VERSION\"" fitl-js/package.json > fitl-js/package.json.tmp
mv fitl-js/package.json.tmp fitl-js/package.json
- name: Update fitl-js/fitl-wasm/Cargo.toml
run: |
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" fitl-js/fitl-wasm/Cargo.toml
- name: Update fitl-rs/Cargo.toml
run: |
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" fitl-rs/Cargo.toml
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add fitl-js/package.json fitl-js/fitl-wasm/Cargo.toml fitl-rs/Cargo.toml
git commit -m "Update version to $VERSION"
git push
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.87
8 changes: 0 additions & 8 deletions fitl-js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3fc3f69

Please sign in to comment.