generated from inetum-peru/base-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (49 loc) · 1.41 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
name: create-release
on:
workflow_run:
workflows: ['lint-code']
types:
- completed
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
# https://semver.org/ proper release tags, more or less
- 'v[0-9]+.[0-9]+.[0-9]+'
# prerelease tags, more or less
- 'v[0-9]+.[0-9]+.[0-9]+-*'
jobs:
release:
runs-on: ubuntu-20.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
container:
image: golang:1.16
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: show tag
id: tag
run: |
echo ::set-output name=TAG::${GITHUB_REF##*/}
- name: install
run: |
go get github.com/git-chglog/git-chglog/cmd/git-chglog
- name: generate changelog
run: |
# https://github.com/git-chglog/git-chglog#git-chglog
$(go env GOPATH)/bin/git-chglog \
-c .chglog/config.yml \
-o RELEASE_CHANGELOG.md \
${{ steps.tag.outputs.TAG }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.TAG }}
release_name: ${{ steps.tag.outputs.TAG }}
draft: true
prerelease: false
body_path: RELEASE_CHANGELOG.md