From 63e6a7f095f3a27b5be81092d188ce7ce4e23e92 Mon Sep 17 00:00:00 2001 From: portugal <144259784+laisspportugal@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:33:00 +0100 Subject: [PATCH] [Feat] Adding bump version script (#132) **User-Facing Changes** N/A **Description** This PR aims to create a Github Actions script to bump versions automatically on package.json files and to edit the PR description script since we will not need to check it manually. **Checklist** - [x] The web version was tested and it is running ok - [x] The desktop version was tested and it is running ok - [x] I've updated/created the storybook file(s) --- .github/pull_request_template.md | 1 - .github/workflows/bump-version.yml | 55 ++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/bump-version.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 10bff5a8ec..2a9db0a23d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -13,4 +13,3 @@ - [ ] The web version was tested and it is running ok - [ ] The desktop version was tested and it is running ok - [ ] I've updated/created the storybook file(s) -- [ ] The release version was updated on package.json files diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml new file mode 100644 index 0000000000..a57261ef8e --- /dev/null +++ b/.github/workflows/bump-version.yml @@ -0,0 +1,55 @@ +name: Auto Bump Version + +on: + push: + branches: + - main # Trigger on push to main branch + +jobs: + bump: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + lfs: true + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '14' + + - run: corepack enable + + - name: Install dependencies + run: yarn install --mode skip-build + env: + # yarn runs in immutable mode "by default" in CI -- turning this off requires an + # undocumented env var + YARN_ENABLE_IMMUTABLE_INSTALLS: false + + - name: Set up Git + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + + - name: Bump version in root package.json + run: yarn version patch + + - name: Bump version in packages/suite + working-directory: packages/suite + run: yarn version patch + + - name: Commit version bumps + run: | + git add package.json yarn.lock packages/suite/package.json + git commit -m "chore: bump versions in root and suite package.json" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Push changes + run: | + git push origin main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}