ci: create releases maybe (#11) #2
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: Create Releases | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
uses: ./.github/workflows/tests.yaml | |
secrets: inherit | |
# only run if the commit message begins with "bump:" | |
if: "startsWith(github.event.head_commit.message, 'bump:')" | |
bump_version: | |
runs-on: ubuntu-latest | |
# only run if the other jobs succeed | |
needs: | |
- tests | |
permissions: | |
contents: read | |
# only run if the commit message begins with "bump:" | |
if: "startsWith(github.event.head_commit.message, 'bump:')" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ssh-key: "${{ secrets.DEPLOY_KEY }}" | |
- id: cz | |
name: Create changelog and bump version | |
uses: commitizen-tools/[email protected] | |
with: | |
changelog: true | |
changelog_increment_filename: "changes.md" | |
git_redirect_stderr: true | |
push: false | |
- name: Push changelog updates | |
run: | | |
git push origin main --tags | |
- name: Create release | |
uses: softprops/[email protected] | |
with: | |
body_path: "changes.md" | |
tag_name: "${{ steps.cz.outputs.version }}" | |
- run: | | |
echo "Bumped to version ${{ steps.cz.outputs.version }}" |