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
208 changes: 208 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
name: Release
on:
workflow_run:
workflows: [Model-free CI]
types: [completed]
branches: [main]
schedule:
- cron: '23 */6 * * *'
workflow_dispatch:
inputs:
bump:
description: Version bump from the newest vMAJOR.MINOR.PATCH tag
required: true
default: minor
type: choice
options: [patch, minor, major]
prerelease:
description: Publish as a prerelease (required while bundled license text is unresolved)
required: true
default: true
type: boolean
dry_run:
description: Verify only; do not create tags or a release
required: true
default: true
type: boolean
permissions:
contents: read
concurrency:
group: release
cancel-in-progress: false
# Keep every pending run (such as a manual release) instead of replacing it.
queue: max
jobs:
verify:
name: Verify release candidate
# Unattended runs follow successful main pushes or reconcile on schedule; AUTO_RELEASE is the off switch.
if: >-
github.event_name == 'workflow_dispatch' ||
(vars.AUTO_RELEASE == 'true' && (github.event_name == 'schedule' ||
(github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success')))
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
actions: read
contents: read
outputs:
release: ${{ steps.ci.outputs.release }}
sha: ${{ steps.head.outputs.sha }}
tag: ${{ steps.plan.outputs.tag }}
alias: ${{ steps.plan.outputs.alias }}
move-alias: ${{ steps.plan.outputs.move-alias }}
prerelease: ${{ steps.plan.outputs.prerelease }}
latest: ${{ steps.plan.outputs.latest }}
steps:
- name: Require dispatch from main
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
run: |
echo "::error::Releases are cut only from main."
exit 1
- uses: actions/checkout@v7
with:
ref: main

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Low] Prefer fully qualified ref: refs/heads/main

Using ref: refs/heads/main instead of ref: main avoids ref disambiguation if a tag named main were ever created (for example, pointing to an older main commit that already has a passing Model-free CI push run).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declined (Low): hardening only; no main tag exists, and kept out of this fix's scope.

fetch-depth: 0
persist-credentials: false
- name: Resolve main head
id: head
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
- name: Plan release
id: plan
env:
EVENT: ${{ github.event_name }}
BUMP: ${{ inputs.bump }}
PRERELEASE: ${{ inputs.prerelease }}
AUTO_PRERELEASE: ${{ vars.AUTO_RELEASE_PRERELEASE }}
run: |
if [ "$EVENT" = workflow_dispatch ]; then
node tooling/release.mjs plan "$BUMP" "$PRERELEASE" false
else
node tooling/release.mjs plan patch "${AUTO_PRERELEASE:-true}" true
fi
- name: Require Model-free CI success on this exact commit
id: ci
if: steps.plan.outputs.release == 'true'
env:
GH_TOKEN: ${{ github.token }}
EVENT: ${{ github.event_name }}
REPOSITORY: ${{ github.repository }}
SHA: ${{ steps.head.outputs.sha }}
run: |
count="$(gh api "repos/$REPOSITORY/actions/workflows/ci.yml/runs?head_sha=$SHA&event=push&branch=main&status=success&per_page=1" --jq '.total_count')"
if [ "$count" -lt 1 ]; then
if [ "$EVENT" = workflow_dispatch ]; then
echo "::error::Model-free CI has not succeeded for push $SHA on main."
exit 1
fi
echo "::notice::Model-free CI has not succeeded for $SHA yet; its completion triggers the next release check."
echo "release=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "release=true" >> "$GITHUB_OUTPUT"
- run: corepack enable
if: steps.ci.outputs.release == 'true'
- run: corepack pnpm install --frozen-lockfile --ignore-scripts
if: steps.ci.outputs.release == 'true'
- run: corepack pnpm check
if: steps.ci.outputs.release == 'true'
- name: Require a clean checkout
if: steps.ci.outputs.release == 'true'
run: |
if [ -n "$(git status --porcelain --untracked-files=normal)" ]; then
git status --short
echo "::error::pnpm check left the checkout dirty."
exit 1
fi
publish:
name: Publish ${{ needs.verify.outputs.tag }}
needs: verify
if: needs.verify.outputs.release == 'true' && inputs.dry_run != true
runs-on: ubuntu-latest
timeout-minutes: 5
environment: release
Comment thread
jongio marked this conversation as resolved.
Resolved
permissions:
actions: read
contents: write
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
SHA: ${{ needs.verify.outputs.sha }}
TAG: ${{ needs.verify.outputs.tag }}
ALIAS: ${{ needs.verify.outputs.alias }}
steps:
- name: Require a branch-restricted release environment
run: |
restricted="$(gh api "repos/$REPOSITORY/environments/release" --jq '.deployment_branch_policy != null')"
if [ "$restricted" != true ]; then
echo "::error::The release environment must restrict deployments to selected branches before unattended publication."
exit 1
fi
Comment thread
jongio marked this conversation as resolved.
Resolved
- uses: actions/checkout@v7
with:
ref: ${{ needs.verify.outputs.sha }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
- name: Recheck release plan against current tags
env:
PRERELEASE: ${{ needs.verify.outputs.prerelease }}
MOVE_ALIAS: ${{ needs.verify.outputs.move-alias }}
LATEST: ${{ needs.verify.outputs.latest }}
run: |
RELEASE_TAGS="$(gh api --paginate "repos/$REPOSITORY/git/matching-refs/tags/v" --jq '.[].ref | ltrimstr("refs/tags/")')"
export RELEASE_TAGS
node tooling/release.mjs recheck "$TAG" "$PRERELEASE" "$MOVE_ALIAS" "$LATEST"
- name: Create annotated version tag
run: |
if gh api "repos/$REPOSITORY/git/ref/tags/$TAG" > /dev/null 2>&1; then
actual="$(gh api "repos/$REPOSITORY/commits/refs/tags/$TAG" --jq '.sha')"
if [ "$actual" != "$SHA" ]; then
echo "::error::$TAG already exists at $actual, expected $SHA."
exit 1
fi
echo "$TAG already points to $SHA; resuming."
else
object="$(gh api "repos/$REPOSITORY/git/tags" -f tag="$TAG" -f message="$TAG" -f object="$SHA" -f type=commit --jq '.sha')"
gh api "repos/$REPOSITORY/git/refs" -f ref="refs/tags/$TAG" -f sha="$object" > /dev/null
fi
- name: Publish GitHub Release
Comment thread
jongio marked this conversation as resolved.
Resolved
env:
PRERELEASE: ${{ needs.verify.outputs.prerelease }}
LATEST: ${{ needs.verify.outputs.latest }}
run: |
if state="$(gh release view "$TAG" --repo "$REPOSITORY" --json isDraft,isPrerelease --jq '"\(.isDraft) \(.isPrerelease)"' 2>/dev/null)"; then
if [ "$state" != "false $PRERELEASE" ]; then
echo "::error::Release $TAG exists but is not a published release with prerelease=$PRERELEASE (draft/prerelease: $state)."
exit 1
fi
echo "Release $TAG is already published; resuming."
exit 0
fi
flags=(--verify-tag --generate-notes --title "$TAG" "--latest=$LATEST")
if [ "$PRERELEASE" = true ]; then flags+=(--prerelease); fi
gh release create "$TAG" --repo "$REPOSITORY" "${flags[@]}"
- name: Advance major alias
if: needs.verify.outputs.move-alias == 'true'
run: |
if gh api "repos/$REPOSITORY/git/ref/tags/$ALIAS" > /dev/null 2>&1; then
gh api -X PATCH "repos/$REPOSITORY/git/refs/tags/$ALIAS" -f sha="$SHA" -F force=true > /dev/null
else
gh api "repos/$REPOSITORY/git/refs" -f ref="refs/tags/$ALIAS" -f sha="$SHA" > /dev/null
fi
- name: Verify published refs
env:
MOVE_ALIAS: ${{ needs.verify.outputs.move-alias }}
run: |
refs=("$TAG")
if [ "$MOVE_ALIAS" = true ]; then refs+=("$ALIAS"); fi
for ref in "${refs[@]}"; do
actual="$(gh api "repos/$REPOSITORY/commits/refs/tags/$ref" --jq '.sha')"
if [ "$actual" != "$SHA" ]; then
echo "::error::$ref resolves to $actual, expected $SHA."
exit 1
fi
done
62 changes: 48 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ pnpm check
```

`pnpm check` runs type checking, lint, model-free coverage, deterministic
source-to-bundle comparison, and a clean consumer-directory packaging control.
source-to-bundle comparison, a clean consumer-directory packaging control, and
release-planner tests (`pnpm test:release`).
The clean consumer-directory packaging control deliberately lacks artifact
credentials and verifies invalid-input failure. Linux CI separately exercises
the packaged Action with real Vally acquisition, native mock-executor pass/fail
Expand All @@ -34,7 +35,7 @@ PR check names map directly to these commands:
| Lint | `pnpm lint`: source/test lint rules. |
| Type check | `pnpm typecheck`: strict TypeScript validation. |
| Unit tests | `pnpm test:coverage`: input, policy, reporting, mocked GitHub, tool reuse, orchestration and real model-free native CLI tests with coverage thresholds. |
| Bundle verification | `pnpm check:package`: committed bundle freshness and a clean consumer-directory packaged entry-point test. |
| Bundle verification | `pnpm check:package`: committed bundle freshness, a clean consumer-directory packaged entry-point test, and release-planner tests. |
| Action smoke test | Executes `uses: ./` on Ubuntu with actual acquisition, native mock-executor pass/fail, lint, installation reuse and artifact upload. No models run. |
| evals (Copilot E2E workflow) | For relevant same-repository PRs, directly invokes the default Action on the example. This consumes organization Copilot AI credits. |

Expand Down Expand Up @@ -102,18 +103,51 @@ capability through repository write access and branch governance.

## Release preparation

The first prerelease is [`v0.1.0`](https://github.com/github/evals-action/releases/tag/v0.1.0).
Keep published version tags unchanged. For future releases, verify the packaged
Action at the target commit and update consumer examples to the intended tag.
Action release versions are independent of the selected Vally version.

The moving `v0` tag points to the latest approved 0.x release. After publishing
a new 0.x minor or patch release and verifying its checks, advance only `v0`
to that release's exact commit. Verify the tag target afterward. Do not move
version-specific tags, publish a separate GitHub release for the moving tag,
or use a blanket force-push of all tags. Release publication and advancing the
alias are separate steps; no automatic tag-moving workflow is configured.
Keep `v0` on the 0.x line when introducing a future `v1` release.
The [`Release` workflow](.github/workflows/release.yml) publishes the current
`main` head in two ways:

- **Automatic patch releases** run after each successful `Model-free CI` push
run on `main`, and on a six-hourly reconciliation schedule, only while the
repository variable `AUTO_RELEASE` is `true`. They cut the next patch version
when `src/`, `dist/` or `action.yml` changed since the newest version tag, and
skip docs-, test- or workflow-only changes. A commit since that tag with a
`type!:` subject or `BREAKING CHANGE:` footer fails the run instead of being
released as a patch. `AUTO_RELEASE_PRERELEASE` (default `true`) selects the
prerelease setting. Set `AUTO_RELEASE` to anything else to stop unattended
releases.
- **Manual releases** use `workflow_dispatch` from `main` with `bump`
(`patch`, `minor` or `major`; default `minor`), `prerelease` (default `true`)
and `dry_run` (default `true`). Use them for minor and major versions.

The verify job refuses other dispatch refs and stable releases while
`dist/bundled-dependencies.json` lists `missing-license-text` entries. It then
Comment thread
jongio marked this conversation as resolved.
Resolved
requires a successful `Model-free CI` push run on the exact `main` commit and
reruns `pnpm check` with a clean-tree check. If CI has not yet succeeded on the
head, an automatic run skips; that CI run's completion triggers the next check.
The publish job runs in the `release` environment, creates an annotated version
tag on that commit, publishes the GitHub Release with generated notes, advances the matching
major alias (`v0` for 0.x, `v1` for 1.x) only when the release is the newest of its
major line, and verifies that each written tag resolves to the verified commit.
No version bump commit is needed; `package.json` stays at `0.0.0`. Restrict the
`release` environment's deployment branches to `main`; the publish job fails
before any write when the environment has no branch restriction. It does not
require reviewers, so releases complete without manual approval.
If publication fails partway, use **Re-run failed jobs** on the same run. It
resumes only when an existing version tag already points to the verified commit
and any existing GitHub Release is published with the requested prerelease
setting. It rejects the retry if version tags changed after verification would
alter the alias or latest decision; the next automatic check or a new dispatch
replans in that case.
GitHub Release is marked latest only for a stable release newer than every
existing version tag.

Keep published version tags unchanged. Consumers that pin full commit SHAs
update their pins after release. Action release versions are independent of the selected Vally version.

The moving `v0` tag points to the latest 0.x release. The workflow
never moves version-specific tags or publishes a separate GitHub release for the
moving tag; it force-updates only the matching major alias. Keep `v0` on the 0.x
line when introducing a future `v1` release.

Before proposing a release, verify supported CLI versions and their native
evidence contracts, run the Linux model-free controls, and qualify the optional
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ sticky PR comment** with the suite, eval names, verdicts, and evidence links.
Vally owns selection, execution and grading; the Action handles installation
and GitHub integration.

Use `github/evals-action@v0` for the latest 0.x pilot release
(currently [v0.1.0](https://github.com/github/evals-action/releases/tag/v0.1.0)).
Use `@v0.1.0` to stay on that specific Action release. The `v0` tag advances as
Use `github/evals-action@v0` for the latest 0.x pilot release (see
[releases](https://github.com/github/evals-action/releases)).
Use an exact tag such as `@v0.2.0` to stay on a specific Action release. The `v0` tag advances as
new 0.x releases are published; the interface may change during the pilot.
Supported host: **Linux x64 GitHub-hosted runners**; the Action uses Node 24
without a Node setup step. Your repository's Actions policy must allow it.
Expand Down Expand Up @@ -96,7 +96,7 @@ with:
vally-version: '0.21.0' # Optional; omit for latest stable
```

The Action version (`@v0` or `@v0.1.0`) and Vally version are independent. Selecting a
The Action version (`@v0` or an exact tag such as `@v0.2.0`) and Vally version are independent. Selecting a
published Vally release does not require an Action update. New versions work
while the native CLI and evidence contracts remain compatible.
Unsupported behavior or malformed evidence fails explicitly;
Expand Down Expand Up @@ -456,8 +456,9 @@ checkout and one `uses: ./` step, using the Action's defaults. In your repositor
use `github/evals-action@v0` instead.

The Action prerelease is not listed on Marketplace. Organizations
that require full-SHA Action references can pin the release commit
`83fa12332c3e44ad899f347eaf153a0d9b6432dc` for `v0.1.0`.
that require full-SHA Action references can pin the commit of a
[release tag](https://github.com/github/evals-action/releases), for example
`uses: github/evals-action@<40-character-sha> # v0.2.0`.

## Development and acquisition

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:packaged": "node --test tooling/packaged.test.mjs",
"check:package": "pnpm check:dist && pnpm test:packaged",
"check": "pnpm typecheck && pnpm lint && pnpm test:coverage && pnpm check:dist && pnpm test:packaged"
"test:release": "node --test tooling/release.test.mjs",
"check:package": "pnpm check:dist && pnpm test:packaged && pnpm test:release",
"check": "pnpm typecheck && pnpm lint && pnpm test:coverage && pnpm check:dist && pnpm test:packaged && pnpm test:release"
},
"dependencies": {
"@actions/artifact": "6.3.1",
Expand Down
Loading
Loading