-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbump-release.yaml
More file actions
48 lines (47 loc) · 1.69 KB
/
bump-release.yaml
File metadata and controls
48 lines (47 loc) · 1.69 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
42
43
44
45
46
47
48
# 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@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Set up git config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- uses: commitizen-tools/setup-cz@main
- id: bump-version
run: |
cz bump --yes --annotated-tag
git push --follow-tags
current_version="$(cz version -p)" # ATTENTION: You may have to add the v* at the beginning of the version
echo "current_version=$current_version" >> $GITHUB_OUTPUT
- name: Build changelog for Release
env:
CURRENT_VERSION: ${{ steps.bump-version.outputs.current_version }}
run: |
cz changelog --dry-run "${CURRENT_VERSION}" > .changelog.md
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: ".changelog.md"
tag_name: ${{ steps.bump-version.outputs.current_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: trigger other workflow
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run .github/workflows/trigger-me.yaml \
-f "version=${{ steps.bump-version.outputs.current_version }}"