chore: allow pre major versions to bump patch (#20) #9
This file contains hidden or 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: Changelog | ||
|
Check failure on line 1 in .github/workflows/changelog.yml
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| # for prod releases | ||
| - main | ||
| # for hotfixes | ||
| - release/* | ||
| env: | ||
| HUSKY: 0 # https://typicode.github.io/husky/how-to.html#ci-server-and-docker | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| permissions: | ||
| contents: write | ||
| issues: write | ||
| pull-requests: write | ||
| jobs: | ||
| changelog: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Determine release config based on branch | ||
| id: config_filename | ||
| env: | ||
| DEFAULT_RELEASE_CONFIG_FILE: release-please-config.json | ||
| HOTFIX_RELEASE_CONFIG_FILE: release-please-config.hotfix.json | ||
| run: | | ||
| case "${{ github.ref_name }}" in | ||
| release/*) | ||
| echo "config_filename=${HOTFIX_RELEASE_CONFIG_FILE}" >> $GITHUB_OUTPUT | ||
| echo "mode=hotfix" >> $GITHUB_OUTPUT | ||
| ;; | ||
| *) | ||
| echo "config_filename=${DEFAULT_RELEASE_CONFIG_FILE}" >> $GITHUB_OUTPUT | ||
| echo "mode=feature" >> $GITHUB_OUTPUT | ||
| ;; | ||
| esac | ||
| - uses: googleapis/release-please-action@v4 | ||
| id: release-please | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| config-file: ".github/${{ steps.config_filename.outputs.config_filename }}" | ||
| manifest-file: ".github/release-please-manifest.json" | ||
| target-branch: "${{ github.ref_name }}" | ||
| - name: Create snapshot branch | ||
| if: steps.release-please.outputs.releases_created == 'true' | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout -b snapshot/${{ fromJson(steps.release-please.outputs.releases).'.'.version }} | ||
| git push origin snapshot/${{ fromJson(steps.release-please.outputs.releases).'.'.version }} | ||