Skip to content

Commit 23a6b9a

Browse files
authored
Merge pull request #35 from fluxcd/goreleaser_relnotes
Generate release notes with goreleaser automatically
2 parents e6f4bc1 + e336145 commit 23a6b9a

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/goreleaser.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Unshallow
15+
run: git fetch --prune --unshallow
16+
- name: Set up Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.14
20+
# Similar as to https://github.com/fluxcd/toolkit/blob/master/.github/workflows/release.yaml#L20-L27
21+
- name: Download release notes utility
22+
env:
23+
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz
24+
run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/
25+
- name: Generate release notes
26+
run: |
27+
echo 'CHANGELOG' > /tmp/release.txt
28+
github-release-notes -org fluxcd -repo go-git-providers -since-latest-release >> /tmp/release.txt
29+
- name: Run GoReleaser
30+
uses: goreleaser/goreleaser-action@v2
31+
with:
32+
version: latest
33+
args: release --release-notes=/tmp/release.txt --rm-dist
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# .goreleaser.yml
2+
project_name: go-git-providers
3+
4+
# This is a library so we don't have any build targets, but having goreleaser automatically
5+
# generate release notes for us is nice.
6+
build:
7+
skip: true
8+
9+
# This automatically closes any milestone named the same as the tag
10+
milestones:
11+
- close: true

0 commit comments

Comments
 (0)