Skip to content

Commit 8604f1b

Browse files
committed
ci: Create GitHub release with changelog
1 parent 54bf414 commit 8604f1b

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

.github/workflows/main.yaml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ on:
33
push:
44
tags:
55
- v*
6-
branches:
7-
- master
86
jobs:
97
test:
108
name: Unit Tests
@@ -16,4 +14,35 @@ jobs:
1614
- uses: actions/setup-go@v2
1715
with:
1816
go-version: '^1.13.1'
19-
- run: go test ./...
17+
- run: go test ./...
18+
release:
19+
name: Release
20+
runs-on: ubuntu-latest
21+
needs: test
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
ref: ${{ github.ref }}
26+
- name: Get version
27+
id: get_version
28+
run: |
29+
VERSION="$(echo '${{ github.ref }}' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | tr -d '\n')"
30+
echo "::set-output name=version::${VERSION}"
31+
- run: git fetch --unshallow
32+
- name: Generate Changelog
33+
id: generate_changelog
34+
uses: PSanetra/git-semver-actions/markdown-log@master
35+
with:
36+
version: ${{ steps.get_version.outputs.version }}
37+
- name: Create Release
38+
id: create_release
39+
uses: actions/create-release@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
tag_name: v${{ steps.get_version.outputs.version }}
44+
release_name: Release ${{ steps.get_version.outputs.version }}
45+
body: |
46+
${{ steps.generate_changelog.outputs.changelog }}
47+
draft: false
48+
prerelease: false

0 commit comments

Comments
 (0)