-
Notifications
You must be signed in to change notification settings - Fork 74
58 lines (49 loc) · 1.19 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
on:
push:
tags:
- 'v*'
name: Create release from tag
jobs:
build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container: golang:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y zip
- name: Build
run: ./.github/workflows/build.sh
- uses: actions/upload-artifact@v2
with:
name: dist
path: ./dist/*.zip
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- run: |
set -x
(echo "${GITHUB_REF##*/}"; echo; git cherry -v "$(git describe --abbrev=0 HEAD^)" | cut -d" " -f3-) > CHANGELOG
assets=()
for zip in ./dist/*.zip; do
assets+=("$zip")
done
gh release upload "${GITHUB_REF##*/}" "${assets[@]}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}