name: Release # CI's half of each devvm release. For a pushed release tag, v, it checks the tag's SSH # signature against the signers in the release environment's variable RELEASE_TAG_SIGNERS, never a # list from the tagged commit, builds the release with scripts/release.sh --tag in its pinned # container, signs SHA256SUMS with CI's release key, the environment's secret RELEASE_CI_KEY, adds # a GitHub artifact attestation of every file, and hands SHA256SUMS, its signature and the files it # lists over as the artifact release. It publishes nothing: its token can only read the repo, and # the co-signer, a machine of the maintainer's, finds this run, rebuilds the release, and signs, # makes and publishes it only when its own build matches # (docs/content/docs/contributing/cosigner.md). The release environment needs the maintainer's # approval for each run, and only v* tags may use it (docs/content/docs/contributing/maintaining.md's # CI's release workflow). # # The published base's workflow, base.yml, isn't here yet: it comes with the published base, as a # workflow of its own beside this one, with its own environment, key and artifact, base, which the # co-signer already reads (cosigner.md's Bases). on: push: tags: ["v*"] permissions: {} concurrency: group: release-${{ github.ref }} cancel-in-progress: false jobs: release: name: Build and sign runs-on: ubuntu-24.04 timeout-minutes: 120 environment: release permissions: contents: read id-token: write # the attestation's Sigstore certificate for this run attestations: write # the attestation's record steps: # The whole history, for the check that the tag's commit is on main. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 # A tag whose commit has none of the release keys stops here, before anything is installed or # built: its devvm couldn't check CI's and the co-signer's signatures, so it's published with # scripts/publish.sh --local until the keys are made. release.sh --ci checks the keys in full. - name: Check the release keys run: | [[ -f packaging/keys/release-ci.pub ]] || { echo "::error::$GITHUB_REF_NAME has no release keys in packaging/keys: make them first (docs/content/docs/contributing/github-setup.md, step 1), or publish it with scripts/publish.sh --local" exit 1 } # The tag as it is on GitHub, its tag object and signature, whatever the checkout made of it. - name: Fetch the tag env: TAG: ${{ github.ref_name }} run: git fetch --no-tags --force origin "+refs/tags/$TAG:refs/tags/$TAG" # Only minisign, which signs, as the pinned mise.lock has it, and no cache, as a release builds # from nothing a branch's run could have left. - uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0 with: version: 2026.11.14 install_args: minisign cache: false # The tag's checks against the environment's signers, then the build, in a folder of its own # that holds SHA256SUMS and exactly the files it lists. - name: Build env: TAG: ${{ github.ref_name }} SIGNERS: ${{ vars.RELEASE_TAG_SIGNERS }} DEVVM_RELEASE_RUNTIME: podman run: | set -euo pipefail export DEVVM_RELEASE_SIGNERS=$RUNNER_TEMP/allowed_signers printf '%s\n' "$SIGNERS" > "$DEVVM_RELEASE_SIGNERS" scripts/release.sh --ci "$TAG" "$RUNNER_TEMP/release" # CI's release key goes to minisign through a pipe, never a file, and the signature has to check # out with the tag's packaging/keys/release-ci.pub, which mustn't be a placeholder. - name: Sign SHA256SUMS env: TAG: ${{ github.ref_name }} RELEASE_CI_KEY: ${{ secrets.RELEASE_CI_KEY }} run: | set -euo pipefail minisign=$(mise which minisign) printf '%s\n' "$RELEASE_CI_KEY" | PATH="${minisign%/*}:$PATH" scripts/release.sh --ci-sign "$TAG" "$RUNNER_TEMP/release" - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: subject-checksums: ${{ runner.temp }}/release/SHA256SUMS - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: release path: ${{ runner.temp }}/release/ if-no-files-found: error # Until the co-signer has published it, and a release waits for the maintainer while it # bridges from the old key: the most a public repo keeps an artifact. retention-days: 90