Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SLSA goreleaser config for darwin-arm64 #125

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/slsa-goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ jobs:
go-version: 1.21
evaluated-envs: "COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}, VERSION_PKG:${{needs.args.outputs.version-package}}"

build-darwin-arm64:
permissions:
id-token: write # To sign the provenance.
contents: write # To upload assets to release.
actions: read # To read the workflow path.
needs: args
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
config-file: .slsa-goreleaser-darwin-arm64.yml
go-version: 1.21
evaluated-envs: "COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}, VERSION_PKG:${{needs.args.outputs.version-package}}"

build-windows-amd64:
permissions:
id-token: write # To sign the provenance.
Expand Down
36 changes: 36 additions & 0 deletions .slsa-goreleaser-darwin-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Version for this file.
version: 1

# (Optional) List of env variables used during compilation.
env:
- GO111MODULE=on
- CGO_ENABLED=0

# (Optional) Flags for the compiler.
flags:
- -trimpath
- -tags=netgo

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: darwin

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: arm64

# (Optional) Entrypoint to compile.
main: ./cmd/kubectl-sigstore

# (Optional) Working directory. (default: root of the project)
# dir: ./relative/path/to/dir

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
# {{ .Arch }} will be replaced by goarch field in the config file.
binary: kubectl-sigstore-darwin-arm64

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X '{{ .Env.VERSION_PKG }}.GitVersion={{ .Env.VERSION }}'"
- "-X '{{ .Env.VERSION_PKG }}.gitCommit={{ .Env.COMMIT }}'"
- "-X '{{ .Env.VERSION_PKG }}.buildDate={{ .Env.COMMIT_DATE }}'"
- "-X '{{ .Env.VERSION_PKG }}.gitTreeState={{ .Env.TREE_STATE }}'"
Loading