Updates package versions when a release or hotfix branch is created (#329)
This commit is contained in:
parent
c24bc8f655
commit
0caa51fcc2
30
.github/workflows/update-version.yml
vendored
Normal file
30
.github/workflows/update-version.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: Update packages versions
|
||||||
|
|
||||||
|
on:
|
||||||
|
create:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
change-version:
|
||||||
|
if: (startsWith(github.ref, 'refs/heads/release/') ||
|
||||||
|
startsWith(github.ref, 'refs/heads/hotfix/'))
|
||||||
|
name: "Update packages versions"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: '${{ github.token }}'
|
||||||
|
|
||||||
|
- name: Filter changes and update versions
|
||||||
|
run: |
|
||||||
|
VERSION=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/[^0-9.]*//g')
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
sed -i "s/\(\"version\":\).*/\1 \"$VERSION\",/g" packages/*/package.json
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
uses: EndBug/add-and-commit@v9
|
||||||
|
with:
|
||||||
|
author_name: github-actions[bot]
|
||||||
|
author_email: github-actions[bot]@users.noreply.github.com
|
||||||
|
message: Update version in packages.json to v${{ env.VERSION }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user