Repository navigation
67 lines (61 loc) · 2.42 KB
/
Copy pathrelease.yaml
File metadata and controls
67 lines (61 loc) · 2.42 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
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
name: Releases
on:
push:
tags:
# Matches v0.1.0 and pre-releases such as v0.1.0-rc.1. GoReleaser's
# `prerelease: auto` keeps the latter from being marked "latest".
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
permissions:
contents: read
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
# Required by actions/attest: id-token to mint the Sigstore OIDC token,
# attestations to persist the result. artifact-metadata is not needed
# because we do not push to a registry, so no storage record is created.
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
# GoReleaser needs the full history and tags to build the changelog.
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
# The default GITHUB_TOKEN cannot push to other repositories, so mint a
# short-lived token from the publisher GitHub App, scoped to the Homebrew
# tap and Scoop bucket only.
- name: Create publisher token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
app-id: ${{ secrets.PUBLISHER_APP_ID }}
private-key: ${{ secrets.PUBLISHER_APP_PRIVATE_KEY }}
owner: rackerlabs
repositories: |
homebrew-tap
scoop-bucket
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ steps.app-token.outputs.token }}
SCOOP_BUCKET_TOKEN: ${{ steps.app-token.outputs.token }}
# Generates SLSA build provenance for every artifact listed in
# checksums.txt, so anyone can confirm an archive was built by this
# workflow from this commit:
# gh attestation verify <archive> --repo rackerlabs/understackctl
- name: Attest build provenance
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-checksums: dist/checksums.txt