forked from jrswab/axe
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 1.08 KB
/
Copy pathrelease.yml
File metadata and controls
37 lines (34 loc) · 1.08 KB
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
# .github/workflows/release.yml
# Create binaries on each release
name: goreleaser
on:
push:
tags:
- 'v*' # only version tags trigger a run
permissions:
contents: write # so GoReleaser can create the GitHub Release
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all tags so GoReleaser sees them
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Extract changelog for this version
run: |
VERSION="${GITHUB_REF_NAME#v}"
# Extract the section between this version's heading and the next
awk "/^## \\[${VERSION}\\]/{found=1; next} /^## \\[/{if(found) exit} found" CHANGELOG.md > release-notes.md
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean --release-notes=release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}