diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 77d64b9..af56dfc 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,16 +1,18 @@ name: Release-please -# release-please maintains a "chore(flow-schema): release X.Y.Z" PR that -# bumps packages/flow-schema and updates its CHANGELOG from conventional -# commits. Merging the PR cuts a `flow-schema-vX.Y.Z` tag + GitHub release, -# which triggers the npm publish job below. +# release-please maintains a single release PR covering BOTH packages +# (manifest mode, separate-pull-requests off): it bumps whichever of +# packages/flow-schema (npm) and crates/wavekat-flow (crates.io) have +# releasable commits and updates their CHANGELOGs. Merging the PR cuts a +# `flow-schema-vX.Y.Z` and/or `wavekat-flow-vX.Y.Z` tag + GitHub release, +# which triggers the matching publish job(s) below. # # Publishing is gated on the RELEASE_ENABLED repository variable. npm auth # uses trusted publishing (OIDC): the package's npm settings trust this repo # + this workflow file, so no registry token is stored anywhere. Renaming # this file breaks publishing until the npm trusted-publisher config is -# updated to match. -# The Rust twin lives in release-plz.yml (tags `wavekat-flow-vX.Y.Z`). +# updated to match. crates.io auth is the org-level CARGO_REGISTRY_TOKEN +# secret. (Rust releases moved here from release-plz at 0.0.2.) on: push: @@ -25,6 +27,7 @@ jobs: pull-requests: write outputs: flow_schema_released: ${{ steps.release.outputs['packages/flow-schema--release_created'] }} + wavekat_flow_released: ${{ steps.release.outputs['crates/wavekat-flow--release_created'] }} steps: - uses: googleapis/release-please-action@v4 id: release @@ -54,3 +57,17 @@ jobs: # in the npm CLI. prepublishOnly runs typecheck + test + build first. - run: npm publish working-directory: packages/flow-schema + + cargo-publish: + needs: release-please + if: needs.release-please.outputs.wavekat_flow_released == 'true' && vars.RELEASE_ENABLED == 'true' + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo publish -p wavekat-flow + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 436c8f8..0000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Release-plz - -# release-plz maintains a release PR that bumps the wavekat-flow crate and -# its CHANGELOG from conventional commits; the release job publishes merged, -# unpublished versions to crates.io and cuts a `wavekat-flow-vX.Y.Z` tag + -# GitHub release. -# -# Publishing is gated on the RELEASE_ENABLED repository variable (plus the -# CARGO_REGISTRY_TOKEN secret) so nothing can reach the registry while the -# repo is private — flipping the repo public is: set the variable, add the -# token. The TS twin lives in release-please.yml (tags `flow-schema-vX.Y.Z`). - -on: - push: - branches: [main] - workflow_dispatch: - -jobs: - release-plz-release: - if: vars.RELEASE_ENABLED == 'true' - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: read - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - uses: release-plz/action@v0.5 - with: - command: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - release-plz-pr: - needs: release-plz-release - if: always() - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - concurrency: - group: release-plz-${{ github.ref }} - cancel-in-progress: false - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - uses: release-plz/action@v0.5 - id: release-plz - with: - command: release-pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Job summary - if: always() - run: | - echo "## Release PR" >> "$GITHUB_STEP_SUMMARY" - if [ "${{ steps.release-plz.outputs.prs_created }}" = "true" ]; then - echo "Release PR created." >> "$GITHUB_STEP_SUMMARY" - else - echo "No release PR created." >> "$GITHUB_STEP_SUMMARY" - fi diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 67e5ac0..0d0156b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,4 @@ { - "packages/flow-schema": "0.0.2" + "packages/flow-schema": "0.0.2", + "crates/wavekat-flow": "0.0.2" } diff --git a/CLAUDE.md b/CLAUDE.md index 3eef193..1c2a494 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -54,9 +54,11 @@ shared tests. See `README.md` for the full design and the phased roadmap. Both packages are **published** (`@wavekat/flow-schema` on npm, `wavekat-flow` on crates.io) and stay `0.0.x` until the consumer repos have adopted them. Do not `npm publish` / `cargo publish` manually — releases are cut by the -automation: `release-please` (TS, tags `flow-schema-vX.Y.Z`) and `release-plz` -(Rust, tags `wavekat-flow-vX.Y.Z`) maintain release PRs; merging a release PR -publishes. Publish jobs are gated on the `RELEASE_ENABLED` repo variable +automation: `release-please` maintains **one combined release PR** covering +both packages (tags `flow-schema-vX.Y.Z` and `wavekat-flow-vX.Y.Z`); merging +it publishes whichever packages had releasable commits. The crate's `version` +is deliberately literal in its own `Cargo.toml` (not workspace-inherited) so +release-please can bump it. Publish jobs are gated on the `RELEASE_ENABLED` repo variable (set). npm auth is trusted publishing (OIDC — no token; the npm package trusts `release-please.yml` in this repo, so renaming that file breaks publishing); crates.io auth is the org-level `CARGO_REGISTRY_TOKEN` secret. diff --git a/Cargo.toml b/Cargo.toml index 7ad1baa..26c07b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,6 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "0.0.2" edition = "2021" license = "Apache-2.0" rust-version = "1.88" diff --git a/crates/wavekat-flow/Cargo.toml b/crates/wavekat-flow/Cargo.toml index 2198e24..4f47d04 100644 --- a/crates/wavekat-flow/Cargo.toml +++ b/crates/wavekat-flow/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "wavekat-flow" -version.workspace = true +# Literal (not workspace-inherited) so release-please's Cargo updater can +# bump it — the cargo-workspace plugin doesn't rewrite [workspace.package]. +version = "0.0.2" edition.workspace = true license.workspace = true rust-version.workspace = true diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index eebd9e7..935a72f 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -135,7 +135,10 @@ Trigger: the format is stable enough and the repo is ready to be public. consumer repos have adopted the published packages. ### Release automation (match house style) -- [x] Rust: `release-plz` (workflow shape from `wavekat-platform-client`, on +- [x] (Superseded at 0.0.2: Rust releases folded into release-please — one + combined release PR for both packages, `cargo-workspace` plugin, same + `wavekat-flow-vX.Y.Z` tag stream; release-plz removed.) + Rust: `release-plz` (workflow shape from `wavekat-platform-client`, on hosted runners like the rest of this repo's CI). Tags `wavekat-flow-vX.Y.Z` (crate-name prefix so the two tag streams in this repo can't collide). diff --git a/release-please-config.json b/release-please-config.json index 03a52f0..d7883a5 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -3,11 +3,17 @@ "include-component-in-tag": true, "bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": true, + "plugins": ["cargo-workspace"], "packages": { "packages/flow-schema": { "release-type": "node", "package-name": "@wavekat/flow-schema", "component": "flow-schema" + }, + "crates/wavekat-flow": { + "release-type": "rust", + "package-name": "wavekat-flow", + "component": "wavekat-flow" } } } diff --git a/release-plz.toml b/release-plz.toml deleted file mode 100644 index f12da89..0000000 --- a/release-plz.toml +++ /dev/null @@ -1,12 +0,0 @@ -# Rust release automation (twin of release-please-config.json for npm). -# Tag/release names are prefixed with the crate name so they can never -# collide with release-please's `flow-schema-v*` tags in the same repo. - -[workspace] -git_tag_enable = true -git_release_enable = true - -[[package]] -name = "wavekat-flow" -git_tag_name = "wavekat-flow-v{{ version }}" -git_release_name = "wavekat-flow-v{{ version }}"