Skip to content

Commit f72ef04

Browse files
committed
setup build and stuff
1 parent 13d46fd commit f72ef04

File tree

10 files changed

+767
-449
lines changed

10 files changed

+767
-449
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Install Nim
18-
uses: iffy/install-nim@v4 # Use the appropriate version tag
19-
with:
20-
version: "stable"
21-
- name: Install WASI SDK
22-
uses: konsumer/install-wasi-sdk@v1
23-
with:
24-
version: "25"
2517
- name: Build
26-
run: npm run build
18+
run: npm ci && npm run build
2719
- name: Upload artifact
2820
uses: actions/upload-pages-artifact@v3
2921
with:

.github/workflows/release.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Install Nim
16-
uses: iffy/install-nim@v4 # Use the appropriate version tag
17-
with:
18-
version: "stable"
19-
- name: Install WASI SDK
20-
uses: konsumer/install-wasi-sdk@v1
21-
with:
22-
version: "25"
2315
- name: Build
24-
run: npm run build
16+
run: npm ci && npm run build
2517
- run: gh release upload ${{github.event.release.tag_name}} webroot/*.null0
2618
env:
2719
GH_TOKEN: ${{ github.token }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
2-
build/
2+
build/
3+
node_modules/

package-lock.json

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
"version": "0.0.1",
55
"scripts": {
66
"web": "npx -y live-server webroot",
7-
"build:watch": "npx -y nodemon -e nim,png --watch src --exec 'npm run build'",
8-
"build": "CC=/opt/wasi-sdk/bin/clang nim c --threads:off --noMain --cc:env -d:release -d:wasi -d:useMalloc --cpu:wasm32 --os:any --passC:\"-D_WASI_EMULATED_SIGNAL\" --passL:\"-lwasi-emulated-signal\" --passL:\"-Wl,--allow-undefined\" -o:build/main.wasm src/main.nim && cd build && zip -r ../webroot/mygame.null0 . && cd ../src && zip -r ../webroot/mygame.null0 . -x '*.nim' || true",
7+
"build:watch": "npx -y nodemon -e ts,png --watch src --exec 'npm run build'",
8+
"build": "asc src/main.ts --optimize --target release -o build/main.wasm --runtime stub && cd build && zip -r ../webroot/mygame.null0 . && cd ../src && zip -r ../webroot/mygame.null0 . -x '*.ts' || true",
99
"start": "npx -y npm-run-all -p web build:watch"
1010
},
11-
"dependencies": {}
11+
"devDependencies": {
12+
"assemblyscript": "^0.28.7"
13+
}
1214
}

src/main.nim

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

src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { clear, draw_circle, BLUE, RED } from "./null0";
2+
3+
export function load(): void {
4+
clear(BLUE);
5+
draw_circle(320, 240, 150, RED);
6+
}

0 commit comments

Comments
 (0)