diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4376163..e4a3fa9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -22,7 +22,6 @@ jobs: - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version: stable - - run: echo "GOVERSION=$(go version)" >> "$GITHUB_ENV" - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 id: goreleaser with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b564c60..2d7d6c6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,9 +25,8 @@ jobs: contents: write # push docker images to registry packages: write - # use OIDC token for signing - id-token: write # required by attest-build-provenance + id-token: write attestations: write needs: release-tag if: needs.release-tag.outputs.new-tag == 'true' @@ -45,8 +44,6 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up environment - run: echo "GOVERSION=$(go version)" >> "$GITHUB_ENV" - uses: advanced-security/sbom-generator-action@375dee8e6144d9fd0ec1f5667b4f6fb4faacefed # v0.0.1 id: sbom env: @@ -69,7 +66,6 @@ jobs: subject-path: "dist/*.tar.gz" # parse artifacts to the format required for image attestation - run: | - echo "$ARTIFACTS" echo "digest=$(echo "$ARTIFACTS" | jq -r '.[]|select(.type=="Docker Manifest")|select(.name|test("go-cli-github:v"))|.extra.Digest')" >> "$GITHUB_OUTPUT" echo "name=$(echo "$ARTIFACTS" | jq -r '.[]|select(.type=="Docker Manifest")|select(.name|test("go-cli-github:v"))|.name|split(":")[0]')" >> "$GITHUB_OUTPUT" id: image_metadata_go_cli_github diff --git a/.goreleaser.yaml b/.goreleaser.yaml index fa45a1b..b8b2b7b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -9,7 +9,6 @@ builds: -s -w -X "main.commit={{.Commit}}" -X "main.date={{.Date}}" - -X "main.goVersion={{.Env.GOVERSION}}" -X "main.projectName={{.ProjectName}}" -X "main.version=v{{.Version}}" env: diff --git a/cmd/go-cli-github/version.go b/cmd/go-cli-github/version.go index 6eee539..f80aa88 100644 --- a/cmd/go-cli-github/version.go +++ b/cmd/go-cli-github/version.go @@ -3,13 +3,13 @@ package main import ( "encoding/json" "fmt" + "runtime" ) // These variables are set by GoReleaser during the build. var ( commit string date string - goVersion string projectName string version string ) @@ -31,7 +31,7 @@ func (*VersionCmd) Run() error { version, commit, date, - goVersion, + runtime.Version(), }) if err != nil { return err