Skip to content
Open
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
17 changes: 16 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,26 @@ on:
push:
branches:
- main
# GitHub registers manual dispatch from the default branch. The CLI v1 job
# lives on maintenance/cli-v1 so npm provenance points to the released source.
workflow_dispatch:
inputs:
version:
description: Stable CLI version on maintenance/cli-v1
required: true
type: string
dry_run:
description: Build and check without publishing
default: true
type: boolean

concurrency: ${{ github.workflow }}-${{ github.ref }}
# Share this group with maintenance/cli-v1 so neither release can change npm
# tags between the other release's version check and publish.
concurrency: npm-package-release

jobs:
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
14 changes: 12 additions & 2 deletions scripts/release-channel.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ test("the channel command produces only the GitHub Actions output", () => {
assert.equal(output, `prerelease=${releaseChannel(state) === "next"}\n`);
});

test("manual dispatch is registered without enabling the main publish job", () => {
const workflow = read(".github/workflows/publish.yml");
assert.match(workflow, /workflow_dispatch:\s+inputs:\s+version:/);
assert.match(workflow, /concurrency: npm-package-release/);
assert.match(
workflow,
/release:\s+if: github\.event_name == 'push' && github\.ref == 'refs\/heads\/main'/,
);
});

test("all stable-doc publication steps require a stable release channel", () => {
const workflow = read(".github/workflows/publish.yml");
assert.match(
Expand All @@ -61,8 +71,8 @@ test("all stable-doc publication steps require a stable release channel", () =>
);
const conditions = workflow
.split("\n")
.map((line) => line.trim())
.filter((line) => line.startsWith("if: "));
.filter((line) => line.startsWith(" if: "))
.map((line) => line.trim());
assert.equal(conditions.length, 7);
for (const condition of conditions) {
assert.ok(
Expand Down
Loading