Skip to content

Commit 1ec3b01

Browse files
authored
Merge pull request #459 from saasquatch/copilot/add-changesets-tool-setup
Add changesets tool setup to mint-components
2 parents 61167a5 + aaaa59f commit 1ec3b01

9 files changed

Lines changed: 1758 additions & 115 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Mint Components Release
2+
on:
3+
push:
4+
branches: [master]
5+
paths:
6+
- "packages/mint-components/**"
7+
workflow_dispatch:
8+
9+
permissions:
10+
id-token: write
11+
contents: write
12+
pull-requests: write
13+
issues: read
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
name: Release Mint Components
19+
defaults:
20+
run:
21+
working-directory: packages/mint-components
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # de0fa = v6.0.2
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # 53b83 = v6.3.0
28+
with:
29+
node-version: 24
30+
registry-url: https://registry.npmjs.org
31+
32+
- name: Install packages
33+
run: npm ci
34+
35+
- name: Create release pull request or publish to npm
36+
id: changesets
37+
uses: changesets/action@001cd79f0a536e733315164543a727bdf2d70aff # 001cd = v1.5.1
38+
with:
39+
cwd: packages/mint-components
40+
version: npm run version
41+
publish: npm run release
42+
title: "mint-components - Version Packages"
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_CONFIG_PROVENANCE: true
46+
47+
- name: Build docs site
48+
if: steps.changesets.outputs.published == 'true'
49+
run: NODE_ENV=dev npm run build
50+
51+
- name: Authenticate with Google Cloud
52+
if: steps.changesets.outputs.published == 'true'
53+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 7c6bc = v3
54+
with:
55+
token_format: "access_token"
56+
workload_identity_provider: "projects/167728399658/locations/global/workloadIdentityPools/github/providers/github"
57+
service_account: "github-static-site-actions@static-site-proxy.iam.gserviceaccount.com"
58+
59+
- name: Setup GCP
60+
if: steps.changesets.outputs.published == 'true'
61+
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # aa548 = v3.0.1
62+
63+
- name: Deploy docs to bucket
64+
if: steps.changesets.outputs.published == 'true'
65+
run: gsutil -m rsync -d -r www/ gs://stencilbook_static_saasquatch/mint-components/production/

.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: |

.github/workflows/stencilbook.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
deploy:
1515
name: Deploy to static site bucket
1616
runs-on: ubuntu-latest
17+
if: ${{ github.event_name != 'push' || matrix.package != 'mint-components' }}
1718

1819
permissions:
1920
contents: read
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "saasquatch/program-tools" }
6+
],
7+
"commit": false,
8+
"fixed": [],
9+
"linked": [],
10+
"access": "public",
11+
"baseBranch": "master",
12+
"updateInternalDependencies": "patch",
13+
"ignore": []
14+
}

packages/mint-components/CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
<!--
6+
Entries from version 2.1.8 and earlier were authored manually.
7+
8+
Starting with the first release after 2.1.8, this changelog is generated
9+
automatically by Changesets (https://github.com/changesets/changesets)
10+
using the @changesets/changelog-github formatter.
11+
-->
12+
13+
<!-- Changesets-generated entries appear above this line. -->
14+
15+
---
16+
17+
The format below is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
618
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
719

820
## [Unreleased]

0 commit comments

Comments
 (0)