bump: version 1.1.4 → 1.1.5 #35
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: Bump version and Create Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
uses: ./.github/workflows/ci.yml | |
bump-version-and-release: | |
needs: test | |
if: "!startsWith(github.event.head_commit.message, 'bump:')" | |
runs-on: ubuntu-latest | |
name: "Bump version, create changelog, and release" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install commitizen | |
- name: Bump version and create changelog | |
id: cz | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
cz bump --yes --changelog || cz bump --yes --increment PATCH | |
echo "version=$(cz version --project)" >> $GITHUB_OUTPUT | |
echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
cz changelog >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PAT }} | |
branch: ${{ github.ref }} | |
tags: true | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
tag_name: v${{ steps.cz.outputs.version }} | |
release_name: Release ${{ steps.cz.outputs.version }} | |
body: ${{ steps.cz.outputs.changelog }} | |
draft: false | |
prerelease: false |