-
Notifications
You must be signed in to change notification settings - Fork 93
52 lines (45 loc) · 1.36 KB
/
pre-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
49
50
51
52
name: Create Pre-Release
on:
workflow_dispatch:
inputs:
commit:
description: 'Release commit'
required: true
jobs:
pre-release:
name: Pre-release
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Determine minor version
id: tag-setter
run: |
DATE=$(date +"%Y.%m.%d")
PREV_RELEASE=$(git tag --list | tail -1)
PREV_DATE="${PREV_RELEASE%.*}"
MINOR_VERSION=0
case $PREV_DATE in
*"$DATE"*)
MINOR_VERSION=${PREV_RELEASE##*.}
MINOR_VERSION=$((MINOR_VERSION+1))
;;
*)
MINOR_VERSION=0
;;
esac
echo "TAG_VERSION=r.$DATE.$MINOR_VERSION" >> $GITHUB_ENV
- name: Set the release commit
run: echo "RELEASE_COMMIT=${{ github.event.inputs.commit }}" >> $GITHUB_ENV
- name: Create release body file
run: bash .github/scripts/get_description.sh
- name: Set release body
uses: ncipollo/[email protected]
with:
bodyFile: release_body.md
commit: ${{ github.event.inputs.commit }}
prerelease: true
tag: ${{ env.TAG_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}