-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1021 Bytes
/
release.yml
File metadata and controls
33 lines (33 loc) · 1021 Bytes
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
name: Release
on:
workflow_dispatch:
push:
paths: [CHANGELOG.md]
branches: [master]
jobs:
Publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source .github/scripts/changelog.sh
git fetch origin --tags
if [[ ! -z "$version" && -z "$(git tag -l "v$version")" ]]; then
git tag "v$major.$minor.$patch"
git tag "v$major.$minor" --force
git tag "v$major" --force
git push --tags --force
echo "BODY<<EOF" >> $GITHUB_ENV
echo "$(IFS=$'\n'; echo "${log[*]}")" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "TAG=v$version" >> $GITHUB_ENV
fi
shell: bash
- if: ${{ env.TAG != '' }}
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0
with:
body: |
${{ env.BODY }}
tag: ${{ env.TAG }}
token: ${{ secrets.GITHUB_TOKEN }}