-
Notifications
You must be signed in to change notification settings - Fork 61
49 lines (45 loc) · 1.16 KB
/
on-push-tag.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
# This workflow runs when a version tag is pushed.
#
# - Get new tag.
# - If release condidate tag:
# - Cut GitHub pre-release.
name: Prerelease Tag Workflow
on:
push:
tags:
- 'v*'
jobs:
cut_prerelease:
permissions:
contents: write
pull-requests: write
name: Cut Pre-Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
- name: Get new tag
id: newversion
run: |
tag=${GITHUB_REF/refs\/tags\//}
if [[ $tag == *"-rc"* ]]; then
echo "do_prerelease=1" >> $GITHUB_ENV
fi
echo "tag=$(echo $tag)" >> $GITHUB_ENV
echo "New tag is: $tag"
echo "GitHub ref: ${{ github.ref }}"
- name: Cut pre-release
id: cutprerelease
if: ${{ env.build_ok == 1 }}
uses: release-drafter/release-drafter@v5
with:
name: ${{ env.tag }}
tag: ${{ env.tag }}
version: ${{ env.tag }}
prerelease: true
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}