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
88 changes: 88 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Release-please

on:
push:
branches: [main]

env:
CARGO_TERM_COLOR: always

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
name: Maintain Wright release
runs-on: ubuntu-latest
concurrency:
group: release-please-${{ github.ref }}
cancel-in-progress: false
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag: ${{ steps.release.outputs.tag_name }}
release_commit: ${{ steps.release.outputs.sha }}
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: true
token: ${{ github.token }}

- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ github.token }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

- name: Synchronize checked-in release metadata
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ steps.release.outputs.pr }}
run: |
set -euo pipefail
if [[ -z "${PR}" ]]; then
echo 'No release-please PR requires metadata synchronization.'
exit 0
fi
pr_number="$(jq -r '.number // empty' <<<"${PR}")"
if [[ -z "${pr_number}" ]]; then
echo 'release-please returned a PR without a number.' >&2
exit 1
fi

gh pr checkout "${pr_number}"
version="$(tr -d '[:space:]' < version.txt)"
python3 scripts/sync-release-version.py --version "${version}"
python3 scripts/update-dist-manifests.py --version "${version}"
python3 scripts/verify-dist.py

git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add Cargo.toml Cargo.lock dist
git diff --cached --check
if git diff --cached --quiet; then
echo "release metadata already synchronized for ${version}"
exit 0
fi
git commit -m 'chore(release): synchronize Wright product metadata'
git push

release-artifacts:
name: Build and publish release artifacts
needs: release
if: needs.release.outputs.release_created == 'true'
uses: ./.github/workflows/release.yml
with:
ref: ${{ needs.release.outputs.release_commit }}
tag: ${{ needs.release.outputs.release_tag }}
commit: ${{ needs.release.outputs.release_commit }}
secrets: inherit
permissions:
contents: write
id-token: write
packages: write
148 changes: 0 additions & 148 deletions .github/workflows/release-plz.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
type: string
tag:
description: GitHub Release tag created by release-plz
description: GitHub Release tag created by release-please
required: true
type: string
commit:
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
(cd release && sha256sum wright-*.tar.gz wright-*.zip > SHA256SUMS)
ls -l release/

- name: Wait for the release-plz draft Release
- name: Wait for the release-please draft Release
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand Down Expand Up @@ -519,6 +519,7 @@ jobs:
- publish-npm
- publish-github-packages
runs-on: ubuntu-latest
environment: release
steps:
- name: Publish the completed draft Release
env:
Expand Down
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.2.4"
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

All notable changes to Wright will be documented in this file.
2 changes: 1 addition & 1 deletion dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ install script stops covering the declared target matrix.

## Publication process

The release-plz workflow creates one draft GitHub Release and calls the
The release-please workflow creates one draft GitHub Release and calls the
reusable release workflow (`release.yml`) with its tag and merge commit. The
workflow keeps the Release draft until native and package-manager distribution
stages complete:
Expand Down
29 changes: 15 additions & 14 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public distribution
commit, build timestamp, and the runtime-dependency claim
(`"requires": { "node": false, "overpy": false }`).

This is the local staging path and the validation suite behind the release-plz
This is the local staging path and the validation suite behind the release-please
workflow; the reusable GitHub workflow publishes the per-platform archives,
and this script verifies and packages the host platform.

Expand Down Expand Up @@ -46,18 +46,19 @@ envelope carries `wright.version` + `wright.contract`. The release archive's

## Public distribution contract

A merge to `main` drives `.github/workflows/release-plz.yml`. The release
A merge to `main` drives `.github/workflows/release-please.yml`. The release
workflow is the single product release path:

1. `release-plz release-pr` maintains a Release PR for the single product
package `wright-cli`. `release-plz.toml` uses `git_only = true`, so no
workspace crate is published to crates.io.
1. `release-please-action` maintains one root Release PR for the Wright
product. `release-please-config.json` uses the `simple` release type, with
`version.txt` and `CHANGELOG.md` as its product-level version and changelog
files. No workspace crate is published to crates.io.
2. The Release PR updates the shared workspace version, `Cargo.lock`, and the
checked-in `dist/` metadata. All workspace crate changes are included in the
product changelog decision.
3. Merging that Release PR runs `release-plz release`, which creates exactly
one `vX.Y.Z` tag and a draft GitHub Release. The job passes the release-plz
tag and merge commit to the reusable `release.yml` workflow.
3. Merging that Release PR runs release-please, which creates exactly one
`vX.Y.Z` tag and a draft GitHub Release. The job passes the release-please
tag and release commit to the reusable `release.yml` workflow.
4. The reusable workflow verifies the tag/revision and version identity, runs
`scripts/release.sh` and `scripts/verify-dist.py`, builds and smoke-tests the
native matrix, attaches archives/checksums/manifests/npm tarballs to the
Expand All @@ -72,12 +73,12 @@ Release/tag available for a retry; it does not create a new product version.
The Release PR is the release decision point. Maintainers do not enter a
version, edit version files, create a tag, or dispatch a second workflow for
the normal case. Review and merge the automatically maintained Release PR;
release-plz derives the next version from the shared workspace history and
creates the one product tag/release.
release-please derives the next version from Conventional Commits and creates
the one product tag/release.

The `release.yml` workflow is reusable and is intentionally not triggered by a
tag or Release event. The default Actions token cannot start a new workflow
from a tag push; passing release-plz outputs through a job dependency keeps
from a tag push; passing release-please outputs through a job dependency keeps
the release in one run.

### Target matrix and artifact naming
Expand Down Expand Up @@ -137,11 +138,11 @@ before attaching them to the draft Release.
### Repository configuration

Enable Actions to create and approve pull requests, and grant the default
repository `GITHUB_TOKEN` `contents: write` and `pull-requests: write` for the
release-plz workflow. The reusable distribution workflow also needs
repository `GITHUB_TOKEN` `contents: write`, `issues: write`, and
`pull-requests: write` for the release-please workflow. The reusable distribution workflow also needs
`id-token: write` for npm provenance and `packages: write` for GitHub Packages.
Create a protected `release` environment if publication approval is required;
the release job is the only job that uses it.
the final `publish-release` job is the only job that uses it.

Configure these optional/required environment secrets:

Expand Down
13 changes: 13 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "simple",
"version-file": "version.txt",
"changelog-path": "CHANGELOG.md",
"include-component-in-tag": false,
"draft": true,
"force-tag-creation": true
}
}
}
Loading
Loading