-
Notifications
You must be signed in to change notification settings - Fork 5
104 lines (92 loc) · 3.22 KB
/
Copy pathrelease.yml
File metadata and controls
104 lines (92 loc) · 3.22 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: goreleaser-release
on:
push:
tags:
- 'v*'
jobs:
test:
name: Run Tests
runs-on: depot-ubuntu-22.04-4
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: 1.x
check-latest: true
cache: true
- name: Go Test
run: |
go run main.go --version
go test -race -v -timeout 5m github.com/overmindtech/cli github.com/overmindtech/cli/tfutils
# Actually release the binaries including signing them
release:
runs-on: depot-ubuntu-22.04-32
if: ${{ github.event_name != 'pull_request' }}
needs: test
permissions:
contents: write
packages: write
# id-token + attestations are required for Sigstore OIDC + the GitHub
# Artifact Attestations API used by attest-build-provenance.
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: 1.x
check-latest: true
cache: true
# Syft is the SBOM generator GoReleaser shells out to (see the `sboms:`
# block in .goreleaser.yaml). It is not preinstalled on GitHub-hosted
# runners, so download it before goreleaser runs.
- name: Install Syft
uses: anchore/sbom-action/download-syft@v0.24.2
- name: Run GoReleaser (publish)
uses: goreleaser/goreleaser-action@v7
with:
# renovate: datasource=github-releases depName=goreleaser/goreleaser
version: "v2.18.0"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Used to create PRs on the Winget repo
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
# Generate SLSA Level 3 build provenance attestations for the release
# archives and the checksums file. Each attestation is signed via Sigstore
# using the workflow's GitHub OIDC identity, recorded in the public Rekor
# transparency log, and surfaced on the repo's Attestations tab. Customers
# verify with `gh attestation verify --repo overmindtech/cli` or
# `cosign verify-blob-attestation`. See
# docs.overmind.tech/docs/cli/verifying-releases.md.
- name: Attest build provenance for release archives
uses: actions/attest-build-provenance@v4
with:
subject-path: |
dist/overmind_cli_*.tar.gz
dist/overmind_cli_*.zip
dist/checksums.txt
- name: Install cloudsmith CLI
run: |
pip install --upgrade cloudsmith-cli
- name: Upload packages to cloudsmith
run: |
for i in dist/*.apk; do
cloudsmith push alpine overmind/tools/alpine/any-version $i
done
for i in dist/*.deb; do
cloudsmith push deb overmind/tools/any-distro/any-version $i
done
for i in dist/*.rpm; do
cloudsmith push rpm overmind/tools/any-distro/any-version $i
done
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}