Skip to content
Merged
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
64 changes: 64 additions & 0 deletions .github/workflows/shared-go-auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ jobs:
run: |-
sudo apt-get update && sudo apt-get install -y git gnupg2

- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit

# syft binary that .goreleaser.yml's sboms: block shells out to.
- name: "Install syft"
uses: anchore/sbom-action/download-syft@3ad7283483fc7af8ff2b4ea19663c2d5ca935e26 # v0.24.2

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down Expand Up @@ -236,6 +245,7 @@ jobs:

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
id: releaser
with:
workdir: source
version: latest
Expand All @@ -246,6 +256,60 @@ jobs:
GO_RELEASER_TARGET_COMMITISH: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
GO_RELEASER_DRAFT_MODE: ${{ inputs.draft }}

# Real Sigstore-backed provenance for every binary this job just built
# locally — no longer a re-fetch, so this is genuine build-time
# GitHub-native attestation stacked on top of cosign (a different
# verification mechanism/consumer than cosign, e.g. `gh attestation
# verify`), not a second re-fetch-and-sign layer.
- name: "Attest build provenance"
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
github-token: ${{ steps.github-app.outputs.token }}
subject-path: 'source/dist/*'

- name: "Resolve checksums file"
id: checksums
run: |
file="$(find source/dist -maxdepth 1 -name '*_SHA256SUMS' -print -quit)"
if [ -z "$file" ]; then
echo "No *_SHA256SUMS file found in dist/" >&2
exit 1
fi
echo "file=$file" >> "$GITHUB_OUTPUT"

# Bind a source-tree SBOM to the checksums file — it already commits to
# every binary's exact digest, so it's a well-defined single-artifact
# anchor for a release that ships multiple platform binaries. Separate
# from .goreleaser.yml's per-archive sboms: block (bound to individual
# archives, uploaded to the release directly by GoReleaser itself).
# - name: "Generate and attest source-tree SBOM"
# uses: anchore/sbom-action@3ad7283483fc7af8ff2b4ea19663c2d5ca935e26 # v0.24.2
# with:
# github-token: ${{ steps.github-app.outputs.token }}
# path: source/
# format: spdx-json
# output-file: source/dist/atmos-sbom.spdx.json
# # We upload the SBOM to the GitHub release ourselves in the next
# # step, so skip the action's own GH Actions workflow-artifact
# # upload — it depends on the runner's internal artifact-caching
# # proxy, which has been unreliable on our self-hosted runners.
# upload-artifact: false

# - name: "Attest SBOM"
# uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
# with:
# github-token: ${{ steps.github-app.outputs.token }}
# subject-path: source/
# sbom-path: source/dist/atmos-sbom.spdx.json

# - name: "Upload source-tree SBOM to the release"
# env:
# GITHUB_TOKEN: ${{ steps.github-app.outputs.token }}
# TAG: ${{ fromJSON(steps.releaser.outputs.metadata).tag }}
# run: |
# gh release upload "$TAG" source/dist/atmos-sbom.spdx.json \
# --repo "${{ github.repository }}" --clobber

- name: Check disk space after
if: success() || failure()
shell: bash
Expand Down
Loading