-
Notifications
You must be signed in to change notification settings - Fork 1k
35 lines (30 loc) · 963 Bytes
/
github_release.yml
File metadata and controls
35 lines (30 loc) · 963 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
34
35
name: Creates a GitHub Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
- name: Extract changelog for version
run: bash .github/extract-changelog.sh "${{ steps.version.outputs.version }}" > release_notes.md
- name: Create GitHub Release
run: |
PRERELEASE_FLAG=""
if [[ "${{ steps.version.outputs.version }}" == *-rc* ]]; then
PRERELEASE_FLAG="--prerelease"
fi
gh release create "${{ steps.version.outputs.version }}" \
--title "${{ steps.version.outputs.version }}" \
--notes-file release_notes.md \
$PRERELEASE_FLAG