Skip to content

Commit c54b5bc

Browse files
committed
wip
1 parent 18d979f commit c54b5bc

File tree

2 files changed

+15
-59
lines changed

2 files changed

+15
-59
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ on:
1111
types: [created]
1212

1313
jobs:
14-
build-and-test:
15-
name: Build and Test
14+
build-test-publish:
15+
name: Build, Test & Publish
1616
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
id-token: write
1720

1821
steps:
1922
- name: Checkout code
@@ -29,6 +32,13 @@ jobs:
2932
experimental-features = nix-command flakes
3033
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
3134
35+
- name: Setup Node.js (for publishing)
36+
if: (github.event_name == 'release' && github.event.action == 'created') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: "20"
40+
registry-url: "https://registry.npmjs.org"
41+
3242
- name: Cache Emscripten
3343
uses: actions/cache@v3
3444
with:
@@ -94,64 +104,9 @@ jobs:
94104
test/*.log
95105
if-no-files-found: ignore
96106

97-
publish:
98-
name: Publish
99-
needs: build-and-test
100-
runs-on: ubuntu-latest
101-
if: (github.event_name == 'release' && github.event.action == 'created') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
102-
permissions:
103-
contents: write
104-
id-token: write
105-
106-
steps:
107-
- name: Checkout code
108-
uses: actions/checkout@v4
109-
with:
110-
submodules: recursive
111-
112-
- name: Install Nix
113-
uses: cachix/install-nix-action@v24
114-
with:
115-
nix_path: nixpkgs=channel:nixos-unstable
116-
extra_nix_config: |
117-
experimental-features = nix-command flakes
118-
119-
- name: Setup Node.js
120-
uses: actions/setup-node@v4
121-
with:
122-
node-version: "20"
123-
registry-url: "https://registry.npmjs.org"
124-
125-
- name: Cache Emscripten
126-
uses: actions/cache@v3
127-
with:
128-
path: .emscripten-cache
129-
key: ${{ runner.os }}-emscripten-${{ hashFiles('flake.lock') }}
130-
restore-keys: |
131-
${{ runner.os }}-emscripten-
132-
133-
- name: Cache OpenSSL
134-
uses: actions/cache@v3
135-
with:
136-
path: openssl-wasm
137-
key: ${{ runner.os }}-openssl-3.3.2-wasm
138-
restore-keys: |
139-
${{ runner.os }}-openssl-
140-
141-
- name: Build OpenSSL
142-
run: |
143-
if [ ! -d "openssl-wasm/lib" ]; then
144-
echo "Building OpenSSL for WASM..."
145-
nix develop --command bash -c "./build-openssl.sh"
146-
else
147-
echo "Using cached OpenSSL"
148-
fi
149-
150-
- name: Build WASM for release
151-
run: |
152-
nix develop --command bash -c "./build.sh"
153-
107+
# Publishing steps (only run on tags)
154108
- name: Verify package contents
109+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
155110
run: |
156111
npm pack --dry-run
157112
ls -lh dist/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.dbs
2+
test-db.html
23

34
# Build artifacts
45
build/

0 commit comments

Comments
 (0)