-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbump-release.yaml
More file actions
41 lines (40 loc) · 1.31 KB
/
bump-release.yaml
File metadata and controls
41 lines (40 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# YES, YOU CAN COPY-PASTE THIS ACTION AND IT SHOULD WORK
# keep in mind, that it won't trigger other actions because it's using action permissions.
# You can: use a PAT token or a workflow_call to trigger another action
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
with:
python-version: "3.x"
- id: bump-version
run: |
cz bump --yes --annotated-tag
git push --follow-tags
new_version="$(cz version -p)"
echo "new_version=$new_version" >> $GITHUB_OUTPUT
new_version_tag="$(cz version -p --tag)"
echo "new_version_tag=$new_version_tag" >> $GITHUB_OUTPUT
- name: Build changelog for Release
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