-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (42 loc) · 1.44 KB
/
release.yml
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
49
name: Release
on:
pull_request:
types:
- closed
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Fetch next version
run: |
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
- name: Check if release is necessary
id: release_guard
run: |
if git tag | grep -q "^${VERSION}$"; then
echo "do_release=false" >> $GITHUB_OUTPUT
else
echo "do_release=true" >> $GITHUB_OUTPUT
fi
- name: Apply release changes
if: steps.release_guard.outputs.do_release == 'true'
run: |
./release.sh $VERSION
- uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: master
skip_checkout: true
commit_message: Release ${{ env.VERSION }}
commit_user_name: ${{ vars.BOT_GITHUB_USERNAME }}
commit_user_email: ${{ vars.BOT_GITHUB_EMAIL }}
- name: Generate release notes
if: steps.release_guard.outputs.do_release == 'true'
env:
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
run: gh release create "$VERSION" --generate-notes -t "$VERSION"