-
Notifications
You must be signed in to change notification settings - Fork 18
71 lines (61 loc) · 1.92 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Release
on:
workflow_dispatch:
inputs:
title:
description: 'Release Title'
required: false
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: Install tools
# gridsite-clients is required for urlencode
run: sudo apt update && sudo apt install -y gridsite-clients
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run build
run: ci/build.sh
- name: Get Latest Tag
id: latest_tag
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
- name: Get Body
id: get_body
run: |
git log --pretty=format:"* %s" ${{ steps.latest_tag.outputs.release }}..HEAD > body.md
- name: Set Tag
id: set_tag
run: |
baseTag=$(date +v%y.%-m.%-d)
tag=$baseTag
count=1
while [ $(git tag -l "$tag") ];
do
tag=$baseTag.$count;
count=$(($count+1));
done
echo tag=$tag >> $GITHUB_OUTPUT
- name: Set Name
id: set_name
run: |
if [[ "${{ github.event.inputs.title }}" != "" ]]; then
echo name="${{ steps.set_tag.outputs.tag }} - ${{ github.event.inputs.title }}" >> $GITHUB_OUTPUT
else
echo name=${{ steps.set_tag.outputs.tag }} >> $GITHUB_OUTPUT
fi
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit: ${{ github.sha }}
tag: ${{ steps.set_tag.outputs.tag }}
name: ${{ steps.set_name.outputs.name }}
token: ${{ secrets.GITHUB_TOKEN }}
bodyFile: body.md
generateReleaseNotes: true