Skip to content

Commit

Permalink
add SLSA goreleaser config for darwin-arm64 (#125)
Browse files Browse the repository at this point in the history
Signed-off-by: hirokuni-kitahara <[email protected]>
  • Loading branch information
hirokuni-kitahara authored Feb 5, 2024
1 parent be1f99b commit e35f818
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
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 }}'"

0 comments on commit e35f818

Please sign in to comment.