-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (57 loc) · 2.22 KB
/
Copy pathchangesets.yml
File metadata and controls
65 lines (57 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Changesets
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
jobs:
changesets:
name: Version or Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # changesets needs full history
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
# ── Rust toolchain (only needed when WASM publishes) ──────────────────
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Install wasm-bindgen-cli
run: |
VERSION=$(cargo metadata --format-version 1 \
| jq -r '.packages[] | select(.name == "wasm-bindgen") | .version')
cargo install wasm-bindgen-cli --version "$VERSION" --locked
# ── Node deps (root workspace install) ───────────────────────────────
- name: Install dependencies
run: npm install
# ── Changesets: creates Version PR OR publishes new versions ──────────
#
# On pushes that include unprocessed .changeset/*.md files:
# → opens / updates a PR titled "chore: version packages"
# → that PR bumps package.json versions and CHANGELOG.md files
#
# On pushes where all changesets have been consumed (i.e. the Version PR
# was just merged):
# → runs `npm run release` (build.mjs + changeset publish)
# → creates a GitHub Release per published package
# → tags HEAD with e.g. @muselab/sf-plugin-busbar-agency@0.1.0
- uses: changesets/action@v1
with:
title: "chore: version packages"
commit: "chore: version packages"
version: npx changeset version
publish: npm run release
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}