-
-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (52 loc) · 1.46 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
name: create-release
on:
workflow_run:
workflows:
- sonar-scan
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]+-*'
env:
TMP_CHANGELOG_FILENAME: TMP_CHANGELOG.md
jobs:
release:
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/')
container:
image: golang:1.16
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Task
uses: arduino/setup-task@v1
- name: Install changelog
run: task changelog:install
- name: Check dependences
run: task changelog:check
- id: get_version
uses: battila7/get-version-action@v2
- name: set vars to github
run: |
echo "APP_TAG=${{ steps.get_version.outputs.version-without-v }}" >> $GITHUB_ENV
- name: Generate changelog
run: task changelog:tag
- name: Create Release
if: ${{ !env.ACT }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ env.APP_TAG }}
release_name: ${{ env.APP_TAG }}
draft: false
prerelease: false
body_path: ${{ env.TMP_CHANGELOG_FILENAME }}