Skip to content

Commit 325f12a

Browse files
chore: release assets for multiple platforms (#434)
* chore: release assets for multiple platforms Signed-off-by: Shunsuke Suzuki <[email protected]> * ci: release assets for windows and macOS Signed-off-by: Shunsuke Suzuki <[email protected]> * ci: add configuration files for macOS and windows Signed-off-by: Shunsuke Suzuki <[email protected]> * ci: remove a workflow job `if-failed` This job is unneeded anymore. #434 (comment) Signed-off-by: Shunsuke Suzuki <[email protected]> * ci: move configuration files to a directory `.slsa-goreleaser` Signed-off-by: Shunsuke Suzuki <[email protected]> Signed-off-by: Shunsuke Suzuki <[email protected]> Co-authored-by: laurentsimon <[email protected]>
1 parent a4d4074 commit 325f12a

File tree

7 files changed

+96
-15
lines changed

7 files changed

+96
-15
lines changed

.github/workflows/release.yml

+11-15
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,24 @@ jobs:
3232
echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> "$GITHUB_OUTPUT"
3333
3434
builder:
35+
name: builder-${{matrix.os}}-${{matrix.arch}}
3536
needs: [args]
37+
strategy:
38+
matrix:
39+
os:
40+
- linux
41+
- windows
42+
- darwin
43+
arch:
44+
- amd64
45+
- arm64
3646
permissions:
3747
actions: read # For the detection of GitHub Actions environment.
3848
id-token: write # For signing.
3949
contents: write # For asset uploads.
4050
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
4151
with:
4252
go-version: 1.18
43-
config-file: .github/config-release.yml
53+
config-file: .slsa-goreleaser/${{matrix.os}}-${{matrix.arch}}.yml
4454
compile-builder: true
4555
evaluated-envs: "VERSION:${{needs.args.outputs.version}}"
46-
47-
# In case this fails, e.g. build configuration changes, file an issue in slsa-verifier
48-
if-failed:
49-
runs-on: ubuntu-latest
50-
needs: [builder]
51-
if: always() && needs.builder.result == 'failure'
52-
steps:
53-
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
54-
with:
55-
repository: slsa-framework/example-package
56-
- run: |
57-
set -euo pipefail
58-
59-
./.github/workflows/scripts/e2e-report-failure.sh

.slsa-goreleaser/darwin-amd64.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Used for pre-submit tests.
2+
version: 1
3+
env:
4+
- GO111MODULE=on
5+
- CGO_ENABLED=0
6+
7+
flags:
8+
- -trimpath
9+
- -tags=netgo
10+
11+
goos: darwin
12+
goarch: amd64
13+
binary: slsa-verifier-{{ .Os }}-{{ .Arch }}
14+
dir: ./cli/slsa-verifier
15+
16+
ldflags:
17+
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"

.slsa-goreleaser/darwin-arm64.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Used for pre-submit tests.
2+
version: 1
3+
env:
4+
- GO111MODULE=on
5+
- CGO_ENABLED=0
6+
7+
flags:
8+
- -trimpath
9+
- -tags=netgo
10+
11+
goos: darwin
12+
goarch: arm64
13+
binary: slsa-verifier-{{ .Os }}-{{ .Arch }}
14+
dir: ./cli/slsa-verifier
15+
16+
ldflags:
17+
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"
File renamed without changes.

.slsa-goreleaser/linux-arm64.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Used for pre-submit tests.
2+
version: 1
3+
env:
4+
- GO111MODULE=on
5+
- CGO_ENABLED=0
6+
7+
flags:
8+
- -trimpath
9+
- -tags=netgo
10+
11+
goos: linux
12+
goarch: arm64
13+
binary: slsa-verifier-{{ .Os }}-{{ .Arch }}
14+
dir: ./cli/slsa-verifier
15+
16+
ldflags:
17+
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"

.slsa-goreleaser/windows-amd64.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Used for pre-submit tests.
2+
version: 1
3+
env:
4+
- GO111MODULE=on
5+
- CGO_ENABLED=0
6+
7+
flags:
8+
- -trimpath
9+
- -tags=netgo
10+
11+
goos: windows
12+
goarch: amd64
13+
binary: slsa-verifier-{{ .Os }}-{{ .Arch }}
14+
dir: ./cli/slsa-verifier
15+
16+
ldflags:
17+
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"

.slsa-goreleaser/windows-arm64.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Used for pre-submit tests.
2+
version: 1
3+
env:
4+
- GO111MODULE=on
5+
- CGO_ENABLED=0
6+
7+
flags:
8+
- -trimpath
9+
- -tags=netgo
10+
11+
goos: windows
12+
goarch: arm64
13+
binary: slsa-verifier-{{ .Os }}-{{ .Arch }}
14+
dir: ./cli/slsa-verifier
15+
16+
ldflags:
17+
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"

0 commit comments

Comments
 (0)