Merge pull request #107 from lucafoscili/candidate #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Version bump (main) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
version-bump: | |
runs-on: ubuntu-latest | |
environment: Production | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
persist-credentials: false | |
- name: Check if version bump is needed | |
id: check_bump | |
run: | | |
if echo "${{ github.event.head_commit.message }}" | grep -q 'chore: bump versions for release'; then | |
echo "Skipping version bump" | |
echo "skip=true" >> $GITHUB_OUTPUT | |
else | |
echo "Proceeding with version bump" | |
echo "skip=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Setup and Build | |
if: steps.check_bump.outputs.skip == 'false' | |
uses: ./.github/actions/setup | |
with: | |
node-version: "18.x" | |
install-immutable: "true" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Configure Git | |
if: steps.check_bump.outputs.skip == 'false' | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
- name: Bump Versions with Lerna (Release) | |
if: steps.check_bump.outputs.skip == 'false' | |
run: | | |
npx lerna version --conventional-graduate --no-push --yes | |
- name: Build Packages | |
if: steps.check_bump.outputs.skip == 'false' | |
run: yarn build | |
- name: Create or Update Pull Request | |
if: steps.check_bump.outputs.skip == 'false' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: "chore: bump versions for release" | |
branch: "version-bump-main" | |
title: "chore: bump versions for release" | |
body: "This PR bumps package versions for the next release." | |
base: "main" | |
labels: "automated PR" |