Skip to content

Commit 0c18a65

Browse files
authored
Merge pull request #944 from LIT-Protocol/feat/naga-changeset-publish
refactor(workflows): consolidate release logic into e2e-naga.yml and …
2 parents 88e0876 + 1b56c47 commit 0c18a65

File tree

2 files changed

+65
-120
lines changed

2 files changed

+65
-120
lines changed

.github/workflows/e2e-naga.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches: [naga, canary-naga]
66
pull_request:
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
build:
1014
name: Build once
@@ -100,3 +104,64 @@ jobs:
100104
- name: Run health check (${{ matrix.network }})
101105
run: NETWORK=${{ matrix.network }} pnpm run test:e2e:ci -- packages/e2e/src/e2e.spec.ts --testNamePattern "^all "
102106
timeout-minutes: 10
107+
108+
release:
109+
name: Release
110+
needs: e2e
111+
runs-on: ubuntu-latest
112+
if: github.event_name == 'push' && needs.e2e.result == 'success'
113+
steps:
114+
- name: Check NPM Token
115+
run: |
116+
if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then
117+
echo "❌ NODE_AUTH_TOKEN secret is not set. Please add it to repository secrets."
118+
exit 1
119+
else
120+
echo "✅ NODE_AUTH_TOKEN secret is available."
121+
fi
122+
123+
- uses: actions/checkout@v4
124+
with:
125+
fetch-depth: 0
126+
ref: ${{ github.ref }}
127+
128+
- uses: actions/setup-node@v4
129+
with:
130+
node-version: 22.18.0
131+
registry-url: https://registry.npmjs.org
132+
cache: pnpm
133+
cache-dependency-path: pnpm-lock.yaml
134+
135+
- name: Enable corepack + pin pnpm
136+
run: |
137+
corepack enable
138+
corepack prepare [email protected] --activate
139+
140+
- uses: actions-rs/toolchain@v1
141+
with:
142+
toolchain: stable
143+
override: true
144+
components: rust-std
145+
146+
- uses: jetli/[email protected]
147+
with:
148+
version: latest
149+
150+
- name: Install Dependencies
151+
run: pnpm install --frozen-lockfile
152+
153+
- name: Build packages
154+
run: pnpm run build
155+
156+
- name: Create Release Pull Request or Publish to npm
157+
id: changesets
158+
uses: changesets/action@v1
159+
with:
160+
branch: ${{ github.ref_name }}
161+
version: pnpm changeset version
162+
publish: pnpm changeset publish --access public
163+
commit: "chore(release): version packages"
164+
title: "chore(release): version packages"
165+
env:
166+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)