forked from mholt/archiver
-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (46 loc) · 1.37 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
# name of the action
name: release
# trigger on push events with `v*` in tag
# ignore push events with `v*-rc*` in tag
on:
push:
tags:
- 'v*'
- '!v*-rc*'
# pipeline to execute
jobs:
release:
runs-on: ubuntu-latest
container:
image: golang:1.16
steps:
- name: clone
uses: actions/checkout@v2
- name: tags
run: |
git fetch --tags
- name: version
id: version
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: install
run: |
go get github.com/git-chglog/git-chglog/cmd/git-chglog
go get github.com/github-release/github-release
- name: changelog
run: |
# https://github.com/git-chglog/git-chglog#git-chglog
$(go env GOPATH)/bin/git-chglog \
-o $GITHUB_WORKSPACE/CHANGELOG.md \
${{ steps.version.outputs.VERSION }}
- name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# https://github.com/github-release/github-release#how-to-use
$(go env GOPATH)/bin/github-release edit \
--user go-vela \
--repo archiver \
--tag ${{ steps.version.outputs.VERSION }} \
--name ${{ steps.version.outputs.VERSION }} \
--description "$(cat $GITHUB_WORKSPACE/CHANGELOG.md)"