Repository navigation
64 lines (55 loc) · 1.93 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (55 loc) · 1.93 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
# The release app credentials live in this environment, which only allows
# v* tags. A workflow on a branch cannot read them.
environment: release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: go test ./...
- name: Generate a changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip header --output CHANGELOG.md
- name: Install Cosign
uses: sigstore/cosign-installer@v4.1.0
# GoReleaser writes to the Homebrew tap and the Scoop bucket as well as this
# repo. The built-in GITHUB_TOKEN cannot write to other repos, so mint a
# short-lived GitHub App installation token scoped to these three repos.
# Mint it last, just before GoReleaser, because the token expires after one hour.
- name: Generate release token
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.RELEASE_APP_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: Runware
repositories: |
runware-cli
homebrew-tap
scoop-bucket
permission-contents: write
- uses: goreleaser/goreleaser-action@v6
with:
# v2.19 is the first version with homebrew_casks hooks install_steps.
# The action reads "~> v2.19" as 2.19.x only, so use "^v2.19" (>=2.19.0 <3.0.0).
# Keep in step with the GoReleaser config check in ci.yml.
version: "^v2.19"
args: release --clean --release-notes=CHANGELOG.md
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}