Skip to content

Commit 33f0b03

Browse files
noahwcCopilot
andcommitted
Mint prereleases though publish-package
Co-authored-by: Copilot <copilot@github.com>
1 parent 45ca752 commit 33f0b03

5 files changed

Lines changed: 27 additions & 101 deletions

File tree

.github/workflows/mint-components-prerelease.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

.github/workflows/mint-components-release.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
permissions:
1010
id-token: write
1111
contents: write
12-
packages: write
1312
pull-requests: write
1413
issues: read
1514

@@ -22,23 +21,20 @@ jobs:
2221
working-directory: packages/mint-components
2322
steps:
2423
- name: Checkout code
25-
uses: actions/checkout@v4
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # de0fa = v6.0.2
2625

2726
- name: Setup Node.js
28-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # 53b83 = v6.3.0
2928
with:
30-
node-version: 20.x
29+
node-version: 24
3130
registry-url: https://registry.npmjs.org
3231

3332
- name: Install packages
3433
run: npm ci
3534

36-
- name: Build package
37-
run: npm run build
38-
3935
- name: Create release pull request or publish to npm
4036
id: changesets
41-
uses: changesets/action@v1
37+
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # 6a0a8 = v1.7.0
4238
with:
4339
version: cd packages/mint-components && npm run version
4440
publish: cd packages/mint-components && npm run release
@@ -53,15 +49,15 @@ jobs:
5349

5450
- name: Authenticate with Google Cloud
5551
if: steps.changesets.outputs.published == 'true'
56-
uses: google-github-actions/auth@v2
52+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 7c6bc = v3
5753
with:
5854
token_format: "access_token"
5955
workload_identity_provider: "projects/167728399658/locations/global/workloadIdentityPools/github/providers/github"
6056
service_account: "github-static-site-actions@static-site-proxy.iam.gserviceaccount.com"
6157

6258
- name: Setup GCP
6359
if: steps.changesets.outputs.published == 'true'
64-
uses: google-github-actions/setup-gcloud@v2
60+
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # aa548 = v3.0.1
6561

6662
- name: Deploy docs to bucket
6763
if: steps.changesets.outputs.published == 'true'

.github/workflows/publish-package.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- express-boilerplate
1212
- integration-boilerplate-node
1313
- logger
14+
- mint-components
1415
- program-boilerplate
1516
- program-test-suite
1617
- publish-helper
@@ -34,6 +35,12 @@ jobs:
3435
id-token: write
3536

3637
steps:
38+
- name: Enforce mint-components prerelease-only policy
39+
if: inputs.package == 'mint-components' && inputs.increment-type != 'prerelease'
40+
run: |
41+
echo "::error::Stable releases of @saasquatch/mint-components must go through the 'Mint Components Release' workflow (Changesets). This workflow only supports 'prerelease' for mint-components."
42+
exit 1
43+
3744
- name: Generate Variables
3845
id: vars
3946
run: |

packages/mint-components/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
"serve:package": "serve . --cors -l 5000",
3535
"start:raisins": "run-p start serve:package",
3636
"postinstall": "patch-package",
37+
"prepack": "npm run build",
3738
"changeset": "changeset",
3839
"version": "changeset version && npm install",
3940
"release": "changeset publish",
40-
"prepublishOnly": "node -e \"if(!process.env.CI)throw new Error('Direct npm publish is disabled for @saasquatch/mint-components. Publish via the Mint Components Release or Mint Components Prerelease GitHub Actions workflow.')\""
41+
"prepublishOnly": "node -e \"if(!process.env.CI)throw new Error('Direct npm publish is disabled for @saasquatch/mint-components. Publish via the Mint Components Release (stable) or Publish Package (prerelease) GitHub Actions workflow.')\""
4142
},
4243
"devDependencies": {
4344
"@changesets/changelog-github": "^0.5.2",

packages/mint-components/readme.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,26 @@ When changesets are merged to the `master` branch, the mint-components release w
4242
- Deploy the production Stencilbook site for mint-components
4343
- Create a git tag for the release
4444

45-
mint-components releases are driven by the mint-specific Changesets workflow rather than the generic `publish-package` workflow.
45+
mint-components stable releases use the mint-specific **Mint Components Release** workflow (Changesets), and prereleases use the shared **Publish Package** workflow.
4646

47-
**Local `npm publish` is blocked.** A `prepublishOnly` script in `package.json` aborts publishes that aren't running in CI (where `CI=true`). All publishes must go through the **Mint Components Release** or **Mint Components Prerelease** GitHub Actions workflows.
47+
**Local `npm publish` is blocked.** A `prepublishOnly` script in `package.json` aborts publishes that aren't running in CI (where `CI=true`). All publishes must go through the GitHub Actions workflows below.
4848

49-
#### Manual Development Releases
49+
#### Manual Development Releases (Prereleases)
5050

51-
For development and testing purposes, use the `Mint Components Prerelease` GitHub Actions workflow from the branch you want to publish.
51+
For development and testing purposes, use the shared **Publish Package** GitHub Actions workflow:
5252

53-
Prereleases are driven manually (not by `changeset pre enter/exit`):
54-
55-
1. On your working branch, edit `version` in [packages/mint-components/package.json](./package.json) to a SemVer prerelease form: `x.y.z-<identifier>` — for example `2.2.0-1`, `2.2.0-beta.0`, or `2.2.0-next.3`. Plain `x.y.z` is rejected by the workflow.
56-
2. Commit and push the version bump to your branch.
57-
3. Run the **Mint Components Prerelease** workflow from that branch and supply the `tag` input (npm dist-tag), e.g. `next` or `beta`. The dist-tag `latest` is rejected so prereleases can never replace the stable channel.
53+
1. Run the workflow from the branch you want to publish.
54+
2. Set `package` to `mint-components`.
55+
3. Set `increment-type` to `prerelease`. The workflow rejects `patch` / `minor` / `major` for mint-components — stable releases must go through the **Mint Components Release** (Changesets) workflow.
5856

5957
The workflow will:
6058

61-
- Validate the version is a prerelease and the tag is not `latest`
62-
- Verify a matching git tag does not already exist
63-
- Build and publish via `npm publish --tag <tag>`
64-
- Create and push a `@saasquatch/mint-components@<version>` git tag
59+
- Compute the next semver from `package.json` (e.g. `2.1.8``2.1.9-0` for `prerelease`)
60+
- Build mint-components automatically via the `prepack` lifecycle script
61+
- Publish to npm with `--access public --provenance`, tagged `next` for prereleases or `latest` for stable
62+
- Commit the version bump and create a signed `@saasquatch/mint-components@<version>` git tag via `saasquatch/git-commit-action`
6563

66-
Stable releases continue to flow through `master` via the Changesets "Version Packages" PR. When the next stable release is cut, `changeset version` will compute the next stable version from changesets and overwrite any manual prerelease version in `package.json` — that is intentional.
64+
Stable releases should still flow through `master` via the Changesets "Version Packages" PR. When the next stable Changesets release runs, `changeset version` will compute the next stable version from changesets and overwrite any manual prerelease version in `package.json` — that is intentional.
6765

6866
## About Stencil
6967

0 commit comments

Comments
 (0)