Skip to content

Commit

Permalink
Merge pull request #23 from raskyld/raskyld-patch-1
Browse files Browse the repository at this point in the history
feat: use one file per os/arch combo
  • Loading branch information
raskyld authored Oct 23, 2023
2 parents bdb9ed0 + 5600f47 commit 5c3bd3b
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go-ossf-slsa3-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
go-version: 1.21
config-file: ".slsa-goreleaser.yaml"
evaluated-envs: "VERSION:${{needs.args.outputs.version}}, TARGET_OS:${{matrix.os}}, TARGET_ARCH:${{matrix.arch}}"
config-file: "hack/slsa-goreleaser/.slsa-goreleaser-${{matrix.os}}-${{matrix.arch}}.yaml"
evaluated-envs: "VERSION:${{needs.args.outputs.version}}"
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ env:
- CGO_ENABLED=0

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: "{{ .Env.TARGET_OS }}"
goos: darwin

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: "{{ .Env.TARGET_ARCH }}"
goarch: amd64

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
Expand Down
22 changes: 22 additions & 0 deletions hack/slsa-goreleaser/.slsa-goreleaser-darwin-arm64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Version for this file.
version: 1

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

# 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

# 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: binary-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X main.Version={{ .Env.VERSION }}"
22 changes: 22 additions & 0 deletions hack/slsa-goreleaser/.slsa-goreleaser-linux-amd64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Version for this file.
version: 1

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

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

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

# 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: binary-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X main.Version={{ .Env.VERSION }}"
22 changes: 22 additions & 0 deletions hack/slsa-goreleaser/.slsa-goreleaser-linux-arm64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Version for this file.
version: 1

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

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

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

# 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: binary-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X main.Version={{ .Env.VERSION }}"

0 comments on commit 5c3bd3b

Please sign in to comment.