-
Notifications
You must be signed in to change notification settings - Fork 295
37 lines (32 loc) · 1.02 KB
/
gh-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
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v1.0.0-alpha, v1.0.0-beta, etc.
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extract tag name
id: extract_tag
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
- name: Set prerelease flag
id: set_prerelease
run: |
if [[ $TAG_NAME == *"-alpha"* || $TAG_NAME == *"-beta"* || $TAG_NAME == *"-rc"* ]]; then
echo "PRERELEASE=true" >> $GITHUB_ENV
else
echo "PRERELEASE=false" >> $GITHUB_ENV
fi
- name: Create Release and Generate Notes
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: 💫 Release ${{ env.TAG_NAME }}
draft: false
prerelease: ${{ env.PRERELEASE }}
generate_release_notes: true