-
Notifications
You must be signed in to change notification settings - Fork 10
48 lines (42 loc) · 1.28 KB
/
release.yaml
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
name: release
on:
workflow_run:
workflows:
- build
branches: [main]
types:
- completed
jobs:
tag-release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: tag-release - ubuntu-latest
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
# Tag the commit with the library version
- name: Create git tag
uses: salsify/action-detect-and-tag-new-version@v2
with:
version-command: scripts/get_version.sh
# Set release output variables
- name: Set output
id: vars
run: |
echo "TAG_NAME=v$(scripts/get_version.sh)" >> $GITHUB_ENV
echo "RELEASE_NAME=$(scripts/get_version.sh)" >> $GITHUB_ENV
echo "## Release notes" > NOTES.md
sed -n '/^## /{n; :a; /^## /q; p; n; ba}' CHANGELOG.md >> NOTES.md
# Create GitHub release
- name: Create release
id: create-release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TAG_NAME }}
append_body: true
body_path: ./NOTES.md