Release 7 - Public verification #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release 7 - Public verification | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Published semantic version without v | |
| required: true | |
| type: string | |
| commit: | |
| description: Exact published 40-character commit SHA | |
| required: true | |
| type: string | |
| publish_run_id: | |
| description: Exact successful Release 6 publish run ID | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: release-public-verify-${{ inputs.version }} | |
| cancel-in-progress: false | |
| jobs: | |
| verify: | |
| name: Verify public user-facing release | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| ref: ${{ inputs.commit }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Verify GitHub Latest, Stable metadata, and ranged downloads | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| VERSION: ${{ inputs.version }} | |
| COMMIT: ${{ inputs.commit }} | |
| PUBLISH_RUN_ID: ${{ inputs.publish_run_id }} | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; [[ "$COMMIT" =~ ^[a-f0-9]{40}$ ]]; [[ "$PUBLISH_RUN_ID" =~ ^[0-9]+$ ]] | |
| publish_run="$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$PUBLISH_RUN_ID")" | |
| test "$(jq -r .name <<<"$publish_run")" = "Release 6 - Publish" | |
| test "$(jq -r .status <<<"$publish_run")" = completed; test "$(jq -r .conclusion <<<"$publish_run")" = success | |
| release="$(gh api "repos/$GITHUB_REPOSITORY/releases/latest")" | |
| test "$(jq -r .tag_name <<<"$release")" = "v$VERSION" | |
| test "$(jq -r .draft <<<"$release")" = false; test "$(jq -r .prerelease <<<"$release")" = false | |
| test "$(jq -r .target_commitish <<<"$release")" = "$COMMIT" | |
| curl -fsSL --retry 4 "https://github.com/$GITHUB_REPOSITORY/releases/download/v$VERSION/1Helm-$VERSION-stable.json" -o stable.json | |
| node -e 'import("./scripts/stable-manifest-lib.mjs").then(({readStableManifest}) => { const m=readStableManifest("stable.json"); if(m.version!==process.env.VERSION||m.commit!==process.env.COMMIT) process.exit(1); })' | |
| for name in "1Helm-$VERSION-linux-node.tgz" "1Helm-$VERSION-arm64.dmg" "1Helm-$VERSION-mac-arm64.zip"; do | |
| code="$(curl -fsSL --retry 4 -r 0-1048575 -o range.bin -w '%{http_code}' "https://github.com/$GITHUB_REPOSITORY/releases/download/v$VERSION/$name")" | |
| test "$code" = 206; test "$(stat -c %s range.bin)" = 1048576 | |
| done |