-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.24 KB
/
build.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
name: Build project
on:
push:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download tags which the git command needs later
run: git fetch --prune --unshallow
- name: Runnning build/generation script
shell: bash
run: |
bash ./release.sh
- name: Generate tag name
run: echo "TAG_NAME=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Generate release title
run: echo "RTITLE=$(git log -n 1 --oneline | cut -d' ' -f2- -)" >> $GITHUB_ENV
- name: Upload release
uses: softprops/action-gh-release@v1
with:
files: releases/*.zip
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.RTITLE }}
fail_on_unmatched_files: true
body_path: release.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete older releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 7
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}