Skip to content

fix(ci): use gh in our own release cycle #16

fix(ci): use gh in our own release cycle

fix(ci): use gh in our own release cycle #16

Workflow file for this run

on:
push:
branches:
- main
jobs:
bump:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- uses: commitizen-tools/setup-cz@main
- uses: pndurette/gh-actions-auto-docs@v1
with:
git_push: false
action_yaml_file: ./action.yaml
heading_size: 2
- id: bump-version
run: |
cz bump --yes
new_version="v$(cz version -p)"
major_version="v$(cz version -p --major)"
new_version_tag="$(cz version -p --tag)"
echo "new_version=$new_version" >> $GITHUB_OUTPUT
echo "major_version=$major_version" >> $GITHUB_OUTPUT
echo "new_version_tag=$new_version_tag" >> $GITHUB_OUTPUT
- name: Update major tag
env:
NEW_VERSION: ${{ steps.bump-version.outputs.new_version }}
MAJOR_VERSION: ${{ steps.bump-version.outputs.major_version }}
run: |
# Push new commit + new tag
git push --follow-tags
# Move major tag to the latest commit
git tag -fa "${MAJOR_VERSION}" -m "release ${NEW_VERSION}"
# Force push new major tag
git push origin "${MAJOR_VERSION}" -f
- name: Build changelog
env:
NEW_VERSION: ${{ steps.bump-version.outputs.new_version }}
run: |
cz changelog --dry-run "${NEW_VERSION}" > .changelog.md
- name: Release
env:
GH_TOKEN: ${{ github.token }}
NEW_VERSION_TAG: ${{ steps.bump-version.outputs.new_version_tag }}
run: |
gh release create "${NEW_VERSION_TAG}" --notes-file .changelog.md