-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (61 loc) · 1.85 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
64
65
66
67
68
69
70
71
72
name: Release
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
version:
description: "Version to release, including the 'v' prefix."
required: true
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.version || github.ref }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: true
- name: Install parse-changelog
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine version (tagged release)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
set -eou pipefail
REF=${{ github.ref }}
echo "VERSION=${REF#refs/tags/v}" >> "$GITHUB_ENV"
- name: Determine version (manual dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo "VERSION=${INPUT_VERSION#v}" >> "$GITHUB_ENV"
env:
INPUT_VERSION: ${{ inputs.version }}
- name: Extract changelog
run: |
parse-changelog CHANGELOG.md ${{ env.VERSION }} > ${{ github.workspace }}-CHANGELOG.txt
echo ::group::CHANGELOG
cat ${{ github.workspace }}-CHANGELOG.txt
echo ::endgroup::
- name: Release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean --release-notes ${{ github.workspace }}-CHANGELOG.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: v${{ env.VERSION }}