bump #10
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: bump | |
on: | |
workflow_dispatch: # Manually trigger | |
inputs: | |
bump: | |
type: choice | |
description: How to bump version | |
options: | |
- minor | |
- major | |
- patch | |
jobs: | |
bump: | |
name: Bump | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for validate job to finish | |
uses: pentible/[email protected] | |
with: | |
check-name: Validate | |
- uses: actions/checkout@v4 | |
- name: Determine New Version | |
id: version | |
uses: zwaldowski/semver-release-action@v4 | |
with: | |
dry_run: true | |
bump: ${{ github.event.inputs.bump }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set Env | |
env: | |
VERSION: v${{ steps.version.outputs.version }} | |
run: echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
- name: Update Version In Code | |
env: | |
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
GIT_COMMITTER_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
run: | | |
npm version --workspaces --no-git-tag-version "$VERSION" | |
git add -u . | |
git commit -m "bumped version to ${VERSION}" | |
git tag "$VERSION" | |
git push --atomic origin HEAD "$VERSION" | |
- name: Create Release | |
env: | |
# NOTE: needs a user token otherwise release events won't be triggered | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: gh release create --generate-notes "$VERSION" |