From 4b1540d193ec5fae5edb913afaeb40888f686352 Mon Sep 17 00:00:00 2001 From: Justin Abrahms Date: Wed, 11 Jan 2023 11:29:09 -0800 Subject: [PATCH] Correct path to config files --- .github/workflows/go-ossf-slsa3-publish.yml | 2 +- .gitignore | 1 - slsa/goreleaser-darwin-amd64.yml | 36 +++++++++++++++++++++ slsa/goreleaser-darwin-arm64.yml | 36 +++++++++++++++++++++ slsa/goreleaser-linux-amd64.yml | 36 +++++++++++++++++++++ slsa/goreleaser-linux-arm64.yml | 36 +++++++++++++++++++++ slsa/goreleaser-windows-amd64.yml | 36 +++++++++++++++++++++ slsa/goreleaser-windows-arm64.yml | 36 +++++++++++++++++++++ 8 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 slsa/goreleaser-darwin-amd64.yml create mode 100644 slsa/goreleaser-darwin-arm64.yml create mode 100644 slsa/goreleaser-linux-amd64.yml create mode 100644 slsa/goreleaser-linux-arm64.yml create mode 100644 slsa/goreleaser-windows-amd64.yml create mode 100644 slsa/goreleaser-windows-arm64.yml diff --git a/.github/workflows/go-ossf-slsa3-publish.yml b/.github/workflows/go-ossf-slsa3-publish.yml index 09da43d..4329332 100644 --- a/.github/workflows/go-ossf-slsa3-publish.yml +++ b/.github/workflows/go-ossf-slsa3-publish.yml @@ -62,4 +62,4 @@ jobs: go-version: 1.17 # Optional: only needed if using ldflags. 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}}" - config-file: .slsa-goreleaser/${{matrix.os}}-${{matrix.arch}}.yml + config-file: slsa/${{matrix.os}}-${{matrix.arch}}.yml diff --git a/.gitignore b/.gitignore index 8605fd7..dc3f445 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /sbom-scorecard /bin coverage.txt -slsa/goreleaser* diff --git a/slsa/goreleaser-darwin-amd64.yml b/slsa/goreleaser-darwin-amd64.yml new file mode 100644 index 0000000..89aa414 --- /dev/null +++ b/slsa/goreleaser-darwin-amd64.yml @@ -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: amd64 + +# (Optional) Entrypoint to compile. +main: ./cmd/sbom-scorecard/main.go + +# (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: sbom-scorecard-{{ .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 }}" + - "-X main.Commit={{ .Env.COMMIT }}" + - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" + - "-X main.TreeState={{ .Env.TREE_STATE }}" diff --git a/slsa/goreleaser-darwin-arm64.yml b/slsa/goreleaser-darwin-arm64.yml new file mode 100644 index 0000000..da68922 --- /dev/null +++ b/slsa/goreleaser-darwin-arm64.yml @@ -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/sbom-scorecard/main.go + +# (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: sbom-scorecard-{{ .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 }}" + - "-X main.Commit={{ .Env.COMMIT }}" + - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" + - "-X main.TreeState={{ .Env.TREE_STATE }}" diff --git a/slsa/goreleaser-linux-amd64.yml b/slsa/goreleaser-linux-amd64.yml new file mode 100644 index 0000000..f004853 --- /dev/null +++ b/slsa/goreleaser-linux-amd64.yml @@ -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: linux + +# The architecture to compile for. `GOARCH` env variable will be set to this value. +goarch: amd64 + +# (Optional) Entrypoint to compile. +main: ./cmd/sbom-scorecard/main.go + +# (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: sbom-scorecard-{{ .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 }}" + - "-X main.Commit={{ .Env.COMMIT }}" + - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" + - "-X main.TreeState={{ .Env.TREE_STATE }}" diff --git a/slsa/goreleaser-linux-arm64.yml b/slsa/goreleaser-linux-arm64.yml new file mode 100644 index 0000000..1220a31 --- /dev/null +++ b/slsa/goreleaser-linux-arm64.yml @@ -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: linux + +# The architecture to compile for. `GOARCH` env variable will be set to this value. +goarch: arm64 + +# (Optional) Entrypoint to compile. +main: ./cmd/sbom-scorecard/main.go + +# (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: sbom-scorecard-{{ .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 }}" + - "-X main.Commit={{ .Env.COMMIT }}" + - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" + - "-X main.TreeState={{ .Env.TREE_STATE }}" diff --git a/slsa/goreleaser-windows-amd64.yml b/slsa/goreleaser-windows-amd64.yml new file mode 100644 index 0000000..a837f91 --- /dev/null +++ b/slsa/goreleaser-windows-amd64.yml @@ -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: windows + +# The architecture to compile for. `GOARCH` env variable will be set to this value. +goarch: amd64 + +# (Optional) Entrypoint to compile. +main: ./cmd/sbom-scorecard/main.go + +# (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: sbom-scorecard-{{ .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 }}" + - "-X main.Commit={{ .Env.COMMIT }}" + - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" + - "-X main.TreeState={{ .Env.TREE_STATE }}" diff --git a/slsa/goreleaser-windows-arm64.yml b/slsa/goreleaser-windows-arm64.yml new file mode 100644 index 0000000..1686b1f --- /dev/null +++ b/slsa/goreleaser-windows-arm64.yml @@ -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: windows + +# The architecture to compile for. `GOARCH` env variable will be set to this value. +goarch: arm64 + +# (Optional) Entrypoint to compile. +main: ./cmd/sbom-scorecard/main.go + +# (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: sbom-scorecard-{{ .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 }}" + - "-X main.Commit={{ .Env.COMMIT }}" + - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" + - "-X main.TreeState={{ .Env.TREE_STATE }}"