-
Notifications
You must be signed in to change notification settings - Fork 1.1k
43 lines (38 loc) · 1.28 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
name: release
on:
push:
tags:
- v*.*.*
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: true
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version-file: go.mod
- name: Run GoReleaser for stable release
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6
if: (!contains(github.ref, 'pre'))
with:
# You can pass flags to goreleaser via GORELEASER_ARGS
# --clean will save you deleting the dist dir
args: release --clean
distribution: goreleaser # or 'goreleaser-pro'
version: "~> v2" # or 'latest', 'nightly', semver
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate changelog for pre release
if: contains(github.ref, 'pre')
id: changelog
run: |
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
gh api repos/$GITHUB_REPOSITORY/releases/generate-notes \
-f tag_name="${GITHUB_REF#refs/tags/}" \
-f target_commitish=main \
-q .body > tmp-CHANGELOG.md
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}