Skip to content

Commit bb22b6c

Browse files
Merge pull request #15 from BitGo/BTC-2652.use-lerna
feat(wasm): switch from multi-semantic-release to lerna
2 parents 5b01d61 + dcb1cc0 commit bb22b6c

File tree

7 files changed

+4372
-9279
lines changed

7 files changed

+4372
-9279
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ jobs:
4646
echo "base ref $GITHUB_BASE_REF"
4747
echo "head ref $GITHUB_HEAD_REF"
4848
49-
- name: Build Info
49+
- name: Configure Git
5050
run: |
51-
echo "node $(node --version)"
52-
echo "npm $(npm --version)"
53-
echo "rust $(rustup --version)"
54-
git --version
51+
git config user.name "github-actions[bot]"
52+
git config user.email "github-actions[bot]@users.noreply.github.com"
5553
5654
- name: Configure NPM
5755
run: |
5856
echo "workspaces-update = false" >> .npmrc
5957
echo "@bitgo:registry=https://registry.npmjs.org" >> .npmrc
60-
echo "//registry.npmjs.org/:always-auth=true" >> .npmrc
58+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
59+
env:
60+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6161

6262
- name: Install Packages
6363
run: npm ci --workspaces --include-workspace-root
@@ -69,7 +69,7 @@ jobs:
6969
run: npm --workspaces test
7070

7171
- name: Release
72-
run: npx multi-semantic-release
72+
run: npx lerna publish --yes --no-verify-access
7373
env:
7474
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7575
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,39 @@ This repo is the home of BitGo's WASM libraries.
99
- [wasm-pack](https://rustwasm.github.io/wasm-pack/) (install with `cargo install wasm-pack`)
1010
- [Node.js](https://nodejs.org/en/)
1111

12+
# Package Management
13+
14+
This monorepo uses [Lerna](https://lerna.js.org/) for managing package versions and publishing to npm.
15+
16+
## Versioning
17+
18+
Packages use **independent versioning** with [Conventional Commits](https://www.conventionalcommits.org/) to automatically determine version bumps:
19+
20+
- `fix:` commits trigger patch releases (0.0.x)
21+
- `feat:` commits trigger minor releases (0.x.0)
22+
- `BREAKING CHANGE:` in commit body triggers major releases (x.0.0)
23+
24+
## Publishing
25+
26+
Publishing is automated via GitHub Actions when changes are pushed to `master` or `beta` branches. The workflow:
27+
28+
1. Builds all packages
29+
2. Runs tests
30+
3. Uses Lerna to analyze commits since last release
31+
4. Automatically versions and publishes changed packages
32+
33+
To manually publish (if needed):
34+
35+
```bash
36+
npx lerna publish
37+
```
38+
39+
To see what would be published without actually publishing:
40+
41+
```bash
42+
npx lerna changed
43+
```
44+
1245
# Packages
1346

1447

lerna.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3+
"version": "independent",
4+
"npmClient": "npm",
5+
"useWorkspaces": true,
6+
"command": {
7+
"publish": {
8+
"conventionalCommits": true,
9+
"message": "chore(release): publish",
10+
"ignoreChanges": [
11+
"**/*.md",
12+
"**/*.test.ts",
13+
"**/*.test.js",
14+
"**/test/**"
15+
]
16+
},
17+
"version": {
18+
"conventionalCommits": true,
19+
"message": "chore(release): version packages"
20+
}
21+
}
22+
}
23+

0 commit comments

Comments
 (0)