Unverified Commit 919395d0 authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

ci: remove release eval dispatcher (#100200)

## Summary

Reverts the combined Next.js changes from #100126 and #100189 by
removing the release-eval dispatcher. Release discovery and execution
will live entirely in `vercel/next-evals-oss`, avoiding a
cross-repository reusable-workflow pin in Next.js.

## Verification

- Not run (workflow deletion only)

<!-- NEXT_JS_LLM -->
parent a871df18
name: Run Next.js Release Evals
on:
workflow_run:
workflows:
- build-and-deploy
types:
- completed
workflow_dispatch:
inputs:
releaseKind:
description: Whether this is a normal release, backport, or canary
required: true
type: choice
options:
- release
- backport
- canary
nextVersion:
description: Exact published Next.js version (for example, 16.2.4 or 16.3.0-canary.12)
required: true
type: string
nextRef:
description: Matching release tag (for example, v16.2.4 or v16.3.0-canary.12)
required: true
type: string
nextSha:
description: Full commit SHA used for the release
required: true
type: string
concurrency:
group: next-release-evals-${{ github.event.workflow_run.head_sha || inputs.nextSha }}
cancel-in-progress: false
permissions: {}
jobs:
identify:
if: ${{ github.repository_owner == 'vercel' && (github.event_name == 'workflow_dispatch' || (github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v'))) }}
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
outputs:
should_run: ${{ steps.release.outputs.should_run }}
release_kind: ${{ steps.release.outputs.release_kind }}
version: ${{ steps.release.outputs.version }}
ref: ${{ steps.release.outputs.ref }}
sha: ${{ steps.release.outputs.sha }}
source_run_url: ${{ steps.release.outputs.source_run_url }}
steps:
- name: Identify the stable release
id: release
uses: actions/github-script@d746ffe35508b1917358783b479e04febd2b8f71 # v9.0.0
env:
MANUAL_RELEASE_KIND: ${{ inputs.releaseKind }}
MANUAL_NEXT_VERSION: ${{ inputs.nextVersion }}
MANUAL_NEXT_REF: ${{ inputs.nextRef }}
MANUAL_NEXT_SHA: ${{ inputs.nextSha }}
MANUAL_SOURCE_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
script: |
if (context.eventName === 'workflow_dispatch') {
const kind = process.env.MANUAL_RELEASE_KIND
const version = process.env.MANUAL_NEXT_VERSION
const ref = process.env.MANUAL_NEXT_REF
const sha = process.env.MANUAL_NEXT_SHA
if (!['release', 'backport', 'canary'].includes(kind)) {
core.setFailed('releaseKind must be release, backport, or canary')
return
}
const stableVersionPattern = /^\d+\.\d+\.\d+$/
const canaryVersionPattern = /^\d+\.\d+\.\d+-canary\.\d+$/
const isExpectedVersion =
kind === 'canary'
? canaryVersionPattern.test(version)
: stableVersionPattern.test(version)
if (!isExpectedVersion || ref !== `v${version}`) {
core.setFailed(
'nextVersion and nextRef must identify an exact release matching releaseKind'
)
return
}
if (!/^[0-9a-f]{40}$/.test(sha)) {
core.setFailed('nextSha must be a full commit SHA')
return
}
core.setOutput('should_run', 'true')
core.setOutput('release_kind', kind)
core.setOutput('version', version)
core.setOutput('ref', ref)
core.setOutput('sha', sha)
core.setOutput('source_run_url', process.env.MANUAL_SOURCE_RUN_URL)
return
}
const workflowRun = context.payload.workflow_run
const releaseRef = workflowRun.head_commit?.message?.trim() || ''
const match = /^v(\d+\.\d+\.\d+)$/.exec(releaseRef)
if (!match || workflowRun.head_branch !== releaseRef) {
core.info('The completed run did not publish a stable release tag')
core.setOutput('should_run', 'false')
return
}
const { data } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: workflowRun.workflow_id,
event: 'push',
head_sha: workflowRun.head_sha,
per_page: 100,
})
const releaseBranches = [
...new Set(
data.workflow_runs
.map((run) => run.head_branch)
.filter(
(branch) =>
branch === 'canary' ||
branch === 'releases/lts/active' ||
branch === 'releases/lts/maintenance' ||
/^next-\d+-\d+$/.test(branch)
)
),
]
// Stable publishes can move an LTS ref to the released SHA after
// the tag and source branch are created. Prefer the release's
// source branch over those LTS mirror runs when both exist.
const sourceBranches = releaseBranches.filter(
(branch) => branch === 'canary' || /^next-\d+-\d+$/.test(branch)
)
const ltsBranches = releaseBranches.filter(
(branch) =>
branch === 'releases/lts/active' ||
branch === 'releases/lts/maintenance'
)
let sourceBranch
if (sourceBranches.length === 1) {
sourceBranch = sourceBranches[0]
} else if (sourceBranches.length === 0 && ltsBranches.length === 1) {
sourceBranch = ltsBranches[0]
} else {
core.setFailed(
`Could not identify one source branch for ${workflowRun.head_sha}; found: ${releaseBranches.join(', ') || 'none'}`
)
return
}
const releaseKind = sourceBranch === 'canary' ? 'release' : 'backport'
core.setOutput('should_run', 'true')
core.setOutput('release_kind', releaseKind)
core.setOutput('version', match[1])
core.setOutput('ref', releaseRef)
core.setOutput('sha', workflowRun.head_sha)
core.setOutput('source_run_url', workflowRun.html_url)
evaluate:
needs: identify
if: needs.identify.outputs.should_run == 'true'
permissions:
contents: read
id-token: write
uses: vercel/next-evals-oss/.github/workflows/release-evals.yml@362f3171c89d62cab234b86e569d750f7f347b67 # PR #138
with:
releaseKind: ${{ needs.identify.outputs.release_kind }}
nextVersion: ${{ needs.identify.outputs.version }}
nextRef: ${{ needs.identify.outputs.ref }}
nextSha: ${{ needs.identify.outputs.sha }}
sourceRunUrl: ${{ needs.identify.outputs.source_run_url }}
vercelOrgId: ${{ vars.VERCEL_NEXT_UPGRADE_EVALS_TEAM_ID }}
vercelProjectId: ${{ vars.VERCEL_NEXT_UPGRADE_EVALS_PROJECT_ID }}
vercelCliClientId: ${{ vars.VERCEL_CLI_CLIENT_ID }}
releaseAgentUrl: ${{ vars.VERCEL_NEXT_EVALS_AGENT_URL }}
releaseGitHubAppClientId: ${{ vars.RELEASE_GITHUB_APP_CLIENT_ID }}
secrets:
releaseGitHubAppPrivateKey: ${{ secrets.RELEASE_GITHUB_APP_PRIVATE_KEY }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment