Skip to content

Commit 96bf3aa

Browse files
committed
feat(CI): add build and release workflows for automated testing and deployment
1 parent b96eb8a commit 96bf3aa

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build & Test
2+
on:
3+
push:
4+
branches: ['dev/anson']
5+
pull_request:
6+
branches: ['dev/anson']
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
has_changesets: ${{ steps.check-changesets.outputs.has_changesets }}
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Install rust
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
override: true
22+
components: rust-std
23+
24+
- name: Install wasm-pack
25+
uses: jetli/[email protected]
26+
with:
27+
version: 'latest'
28+
29+
- name: Setup Node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '22.18.0'
33+
34+
- name: Setup PNPM
35+
uses: pnpm/action-setup@v4
36+
with:
37+
version: 9.15.0
38+
39+
- name: Install Dependencies
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Check current pre-release mode
43+
run: |
44+
if [ -f ".changeset/pre.json" ]; then
45+
echo "📋 Current pre-release mode status:"
46+
cat .changeset/pre.json | jq '{ mode: .mode, tag: .tag }'
47+
else
48+
echo "📋 Not in pre-release mode"
49+
fi
50+
51+
- name: Build
52+
run: pnpm build
53+
54+
- name: Check for changesets
55+
id: check-changesets
56+
run: |
57+
if [ -d ".changeset" ] && [ "$(ls -A .changeset/*.md 2>/dev/null | wc -l)" -gt 0 ]; then
58+
echo "has_changesets=true" >> $GITHUB_OUTPUT
59+
echo "📦 Found changesets - will trigger release workflow"
60+
else
61+
echo "has_changesets=false" >> $GITHUB_OUTPUT
62+
echo "✅ No changesets found - build complete"
63+
fi
64+
65+
trigger-release:
66+
needs: build
67+
if: needs.build.outputs.has_changesets == 'true' && github.event_name == 'push'
68+
uses: ./.github/workflows/release.yml
69+
secrets: inherit

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Release
22
on:
3-
push:
4-
branches: ['dev/anson']
3+
workflow_call:
54

65
permissions:
76
# allow pushing commits, creating tags, and modifying repo files

0 commit comments

Comments
 (0)