name: Canary finalize run-name: Canary finalize ${{ inputs.version }} on: workflow_dispatch: inputs: version: description: Canary version that publish_canary published required: true type: string source_sha: description: Full source commit SHA of that canary required: true type: string release_run_id: description: Release workflow run that published it required: true type: string permissions: {} concurrency: group: canary-finalize-${{ inputs.version }} cancel-in-progress: false env: NPM_PUBLISH_VERIFY_ATTEMPTS: "180" NPM_PUBLISH_VERIFY_DELAY_SECONDS: "10" jobs: confirm_canary: name: Confirm canary on npm and tag it if: github.repository == 'paperclipai/paperclip' && github.repository_id == '1170821064' && github.ref == 'refs/heads/master' runs-on: ubuntu-latest timeout-minutes: 75 permissions: contents: write actions: write outputs: version: ${{ steps.inputs.outputs.version }} source_sha: ${{ steps.inputs.outputs.source_sha }} release_run_id: ${{ steps.inputs.outputs.release_run_id }} steps: - name: Validate inputs id: inputs env: VERSION: ${{ inputs.version }} SOURCE_SHA: ${{ inputs.source_sha }} RELEASE_RUN_ID: ${{ inputs.release_run_id }} run: | set -euo pipefail [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-canary\.[0-9]+$ ]] || { echo "Error: not a canary version" >&2; exit 1; } [[ "$SOURCE_SHA" =~ ^[0-9a-f]{40}$ ]] || { echo "Error: not a full commit SHA" >&2; exit 1; } [[ "$RELEASE_RUN_ID" =~ ^[1-9][0-9]*$ ]] || { echo "Error: not a run id" >&2; exit 1; } { echo "version=$VERSION" echo "source_sha=$SOURCE_SHA" echo "release_run_id=$RELEASE_RUN_ID" } >> "$GITHUB_OUTPUT" - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: ref: ${{ steps.inputs.outputs.source_sha }} fetch-depth: 0 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: 24 - name: Configure git author run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Confirm the canary and push its tag env: VERSION: ${{ steps.inputs.outputs.version }} SOURCE_SHA: ${{ steps.inputs.outputs.source_sha }} PUBLISH_REMOTE: origin run: ./scripts/confirm-canary-publication.sh "$VERSION" "$SOURCE_SHA" - name: Build Docker images for the canary tag env: GH_TOKEN: ${{ github.token }} VERSION: ${{ steps.inputs.outputs.version }} RELEASE_RUN_ID: ${{ steps.inputs.outputs.release_run_id }} run: | { echo "## Canary published" echo "" echo "- Published canary: \`$VERSION\` ([release run](https://github.com/$GITHUB_REPOSITORY/actions/runs/$RELEASE_RUN_ID))" echo "- Docker build dispatched at \`canary/v$VERSION\`" } >> "$GITHUB_STEP_SUMMARY" gh workflow run docker.yml --ref "refs/tags/canary/v$VERSION" --repo "$GITHUB_REPOSITORY" smoke_canary_onboarding: needs: confirm_canary runs-on: ubuntu-latest timeout-minutes: 20 permissions: contents: read actions: read env: PAPERCLIPAI_VERSION: ${{ needs.confirm_canary.outputs.version }} PAPERCLIP_PLAYWRIGHT_CHANNEL: chrome steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: ref: ${{ needs.confirm_canary.outputs.source_sha }} persist-credentials: false - name: Setup pnpm uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6 with: version: 9.15.4 - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: 24 - name: Restore canary smoke lockfile uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: canary-smoke-lockfile-${{ needs.confirm_canary.outputs.source_sha }} run-id: ${{ needs.confirm_canary.outputs.release_run_id }} github-token: ${{ github.token }} - name: Install test dependencies run: pnpm install --frozen-lockfile - name: Show browser version run: google-chrome --version - name: Smoke exact published canary through onboarding env: PAPERCLIP_CANARY_SMOKE_SERVER_LOG: ${{ runner.temp }}/canary-onboarding-server.log run: pnpm run test:canary-onboarding-smoke - name: Upload failed canary onboarding diagnostics if: failure() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: canary-onboarding-smoke-${{ needs.confirm_canary.outputs.version }} if-no-files-found: warn retention-days: 14 path: | ${{ runner.temp }}/canary-onboarding-server.log tests/canary-onboarding/playwright-report/ tests/canary-onboarding/test-results/