Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ jobs:
# alone can come from the previous release and must never turn an aborted
# release command into a green deployment. The convergence gate below
# remains mandatory to prove every machine received one image and config.
# Fly also serves dist: do not expose a committed candidate via the app.
- name: Require committed version to have a complete release
env:
GH_TOKEN: ${{ github.token }}
TESTED_SHA: ${{ github.event.workflow_run.head_sha }}
PUBLICATION_BRANCH: main
run: node scripts/check-release-state.cjs pending

- name: Deploy
id: deploy
env:
Expand Down Expand Up @@ -495,6 +503,8 @@ jobs:

- name: Publish latest artifacts to R2
env:
TESTED_SHA: ${{ github.event.workflow_run.head_sha }}
PUBLICATION_BRANCH: main
ADCP_ARTIFACT_R2_BUCKET: ${{ vars.ADCP_ARTIFACT_R2_BUCKET || 'adcp-artifacts' }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID || secrets.CLOUDFLARE_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -505,7 +515,7 @@ jobs:
echo "::error::Missing R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, or R2_SECRET_ACCESS_KEY secret."
exit 1
fi
npm run backfill:cdn-artifacts -- --bucket "${ADCP_ARTIFACT_R2_BUCKET}" --build-latest --quiet
npm run backfill:cdn-artifacts -- --bucket "${ADCP_ARTIFACT_R2_BUCKET}" --build-latest --latest-only --quiet

# On any failure (hard or fallback-with-degraded-gates), snapshot Fly
# state so the next-turn investigator doesn't have to fetch it
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/recover-protocol-cdn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ concurrency:
group: recover-protocol-cdn-${{ inputs.version }}
cancel-in-progress: false

env:
TESTED_SHA: ${{ github.sha }}
PUBLICATION_BRANCH: main

permissions:
contents: read

Expand All @@ -25,6 +29,11 @@ jobs:
with:
fetch-depth: 0

- name: Preserve current workflow publication fence
run: |
node scripts/check-release-state.cjs current
cp scripts/check-release-state.cjs "$RUNNER_TEMP/check-release-state.cjs"

- name: Install cosign
uses: sigstore/cosign-installer@v3
with:
Expand Down Expand Up @@ -71,6 +80,7 @@ jobs:
- name: Upload only missing immutable R2 objects
env:
VERSION: ${{ inputs.version }}
GH_TOKEN: ${{ github.token }}
BUCKET: ${{ vars.ADCP_ARTIFACT_R2_BUCKET || 'adcp-artifacts' }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID || secrets.CLOUDFLARE_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -83,6 +93,7 @@ jobs:
exit 1
fi

node "$RUNNER_TEMP/check-release-state.cjs" published "$VERSION"
endpoint="https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com"

upload_immutable() {
Expand Down Expand Up @@ -118,14 +129,11 @@ jobs:
exit 1
fi

aws s3 cp "${source}" "s3://${BUCKET}/${key}" \
--endpoint-url "${endpoint}" \
--region auto \
--no-progress \
--only-show-errors \
--no-guess-mime-type \
--cache-control 'public, max-age=31536000, immutable' \
--content-type "${content_type}"
node "$RUNNER_TEMP/check-release-state.cjs" current
aws s3api put-object --bucket "$BUCKET" --key "$key" --body "$source" \
--if-none-match '*' --endpoint-url "$endpoint" --region auto --no-cli-pager \
--cache-control 'public, max-age=31536000, immutable' --content-type "$content_type"
node "$RUNNER_TEMP/check-release-state.cjs" current
echo "Uploaded missing immutable object ${key}"
}

Expand Down
Loading
Loading