Skip to content

Commit 2589b20

Browse files
authored
Merge pull request #911 from LIT-Protocol/feat/changeset-release-with-bun
feat(release): add GitHub Actions workflow for automated releases
2 parents f45fc00 + 935c218 commit 2589b20

File tree

7 files changed

+194
-28
lines changed

7 files changed

+194
-28
lines changed

.changeset/clever-hairs-hope.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@lit-protocol/access-control-conditions': patch
3+
'@lit-protocol/access-control-conditions-schemas': patch
4+
'@lit-protocol/auth': patch
5+
'@lit-protocol/auth-helpers': patch
6+
'@lit-protocol/auth-services': patch
7+
'@lit-protocol/constants': patch
8+
'@lit-protocol/crypto': patch
9+
'@lit-protocol/lit-client': patch
10+
'@lit-protocol/logger': patch
11+
'@lit-protocol/networks': patch
12+
'@lit-protocol/schemas': patch
13+
'@lit-protocol/types': patch
14+
'@lit-protocol/wasm': patch
15+
'@lit-protocol/wrapped-keys': patch
16+
'@lit-protocol/wrapped-keys-lit-actions': patch
17+
---
18+
19+
reset naga-dev contract addresses and add naga-staging network

.changeset/cute-bottles-ask.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
'@lit-protocol/schemas': major
1313
'@lit-protocol/types': major
1414
'@lit-protocol/wasm': major
15-
'@lit-protocol/wrapped-keys': major
16-
'@lit-protocol/wrapped-keys-lit-actions': major
1715
---
1816

1917
first naga beta release

.changeset/cute-experts-clap.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
'@lit-protocol/schemas': patch
1313
'@lit-protocol/types': patch
1414
'@lit-protocol/wasm': patch
15-
'@lit-protocol/wrapped-keys': patch
16-
'@lit-protocol/wrapped-keys-lit-actions': patch
1715
---
1816

1917
Initial version after networks unification

.changeset/cyan-bears-invent.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
'@lit-protocol/schemas': patch
1313
'@lit-protocol/types': patch
1414
'@lit-protocol/wasm': patch
15-
'@lit-protocol/wrapped-keys': patch
16-
'@lit-protocol/wrapped-keys-lit-actions': patch
1715
---
1816

1917
Initial release for networks unification

.changeset/pre.json

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

.github/workflows/prerelease.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Prerelease Snapshot
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
publish:
12+
name: Publish prerelease snapshot
13+
runs-on: ubuntu-latest
14+
env:
15+
RELEASE_BRANCH_PREFIX: 'changeset-release/'
16+
steps:
17+
- name: Ensure Changesets release branch
18+
run: |
19+
if [[ "${GITHUB_REF_NAME}" != ${RELEASE_BRANCH_PREFIX}* ]]; then
20+
echo "❌ This workflow must be triggered on a Changesets release branch. Current branch: ${GITHUB_REF_NAME}"
21+
echo "👉 From the release PR, choose \"Run workflow\" and keep the default branch (changeset-release/...)."
22+
exit 1
23+
fi
24+
25+
- name: Check NPM Token
26+
run: |
27+
if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then
28+
echo "❌ NODE_AUTH_TOKEN secret is not set. Please add it to repository secrets."
29+
exit 1
30+
else
31+
echo "✅ NODE_AUTH_TOKEN secret is available."
32+
fi
33+
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Configure git user
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
44+
- name: Setup Bun
45+
uses: oven-sh/setup-bun@v1
46+
with:
47+
bun-version: latest
48+
49+
- name: Install rust
50+
uses: dtolnay/rust-toolchain@1.76.0
51+
52+
- name: Install wasm-pack
53+
uses: jetli/wasm-pack-action@v0.4.0
54+
with:
55+
version: 'latest'
56+
57+
- name: Setup Node
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: '22.18.0'
61+
registry-url: 'https://registry.npmjs.org'
62+
63+
- name: Install project dependencies
64+
run: bun install --frozen-lockfile
65+
66+
- name: Apply snapshot versions
67+
run: bunx changeset version --snapshot beta
68+
69+
- name: Build workspace
70+
env:
71+
NX_DAEMON: 'false'
72+
run: bun run build
73+
74+
- name: Publish prerelease packages
75+
env:
76+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
77+
run: bunx changeset publish --tag beta
78+
79+
- name: Reset working tree
80+
if: always()
81+
run: |
82+
git reset --hard HEAD
83+
git clean -fd

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- naga
6+
- canary-naga
7+
8+
permissions:
9+
# allow pushing commits, creating tags, and modifying repo files
10+
# needed for the workflow to update package.json versions and CHANGELOG files
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check NPM Token
19+
run: |
20+
if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then
21+
echo "❌ NODE_AUTH_TOKEN secret is not set. Please add it to repository secrets."
22+
exit 1
23+
else
24+
echo "✅ NODE_AUTH_TOKEN secret is available."
25+
fi
26+
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
# Enable this after PNPM migration
33+
# - name: Setup PNPM
34+
# uses: pnpm/action-setup@v4
35+
# with:
36+
# version: 9.15.0
37+
38+
# TODO: Disable this after PNPM migration
39+
- name: Setup Bun
40+
uses: oven-sh/setup-bun@v1
41+
with:
42+
bun-version: latest
43+
44+
- name: Install rust
45+
uses: dtolnay/rust-toolchain@1.76.0
46+
47+
- name: Install wasm-pack
48+
uses: jetli/wasm-pack-action@v0.4.0
49+
with:
50+
version: 'latest'
51+
52+
- name: Setup Node
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: '22.18.0'
56+
registry-url: 'https://registry.npmjs.org'
57+
58+
- name: Install project dependencies
59+
run: bun install --frozen-lockfile
60+
# Enable this after PNPM migration
61+
# run: pnpm install --frozen-lockfile
62+
63+
- name: Check current pre-release mode
64+
run: |
65+
if [ -f ".changeset/pre.json" ]; then
66+
echo "📋 Current pre-release mode status:"
67+
cat .changeset/pre.json | jq '{ mode: .mode, tag: .tag }'
68+
else
69+
echo "📋 Not in pre-release mode"
70+
fi
71+
72+
- name: Build
73+
env:
74+
NX_DAEMON: 'false'
75+
run: bun run build
76+
# Enable this after pnpm migration
77+
# run: pnpm build
78+
79+
- name: Create Release Pull Request or Publish to npm
80+
id: changesets
81+
uses: changesets/action@v1
82+
with:
83+
version: bunx changeset version
84+
publish: bunx changeset publish --access public
85+
# Enable this after pnpm migration
86+
# version: pnpm changeset version
87+
# publish: pnpm changeset publish --access public
88+
commit: 'chore(release): version packages'
89+
title: 'chore(release): version packages'
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

0 commit comments

Comments
 (0)