Skip to content

Commit d0133ff

Browse files
committed
pages: migrate to Astro build
1 parent d2693e5 commit d0133ff

62 files changed

Lines changed: 7050 additions & 1359 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/sample/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ runs:
7171
shell: bash
7272
working-directory: ${{ inputs.soluna_path }}
7373
run: |
74-
SAMPLE_WASM_PATH=$(find bin -name "sample.wasm" | head -n 1)
74+
soluna_root=$(pwd -P)
75+
SAMPLE_WASM_PATH=$(find "$soluna_root/bin" -name "sample.wasm" | head -n 1)
7576
if [ -z "$SAMPLE_WASM_PATH" ]; then
7677
echo "sample.wasm not found" >&2
7778
exit 1

.github/actions/soluna/action.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,14 @@ runs:
114114
- name: Set Output Build Path
115115
id: set-output
116116
run: |
117-
bin_dir=${{inputs.soluna_path}}/bin
117+
soluna_root=$(cd "${{ inputs.soluna_path }}" && pwd -P)
118+
if [ "${{ runner.os }}" == "Windows" ]; then
119+
soluna_root_output=$(cd "${{ inputs.soluna_path }}" && pwd -W | sed 's#\\#/#g')
120+
else
121+
soluna_root_output="$soluna_root"
122+
fi
123+
bin_dir="$soluna_root/bin"
124+
bin_dir_output="$soluna_root_output/bin"
118125
if [ "${{ runner.os }}" == "Windows" ]; then
119126
SOLUNA_BINARY="soluna.exe"
120127
RENAME_BINARY="soluna-windows-amd64.exe"
@@ -125,17 +132,17 @@ runs:
125132
SOLUNA_BINARY="soluna"
126133
RENAME_BINARY="soluna-linux-amd64"
127134
fi
128-
SOLUNA_PATH=$(find $bin_dir -name "$SOLUNA_BINARY" | head -n 1)
135+
SOLUNA_PATH=$(find "$bin_dir" -name "$SOLUNA_BINARY" | head -n 1)
129136
cp "$SOLUNA_PATH" "$bin_dir/$RENAME_BINARY"
130-
echo "SOLUNA_PATH=$bin_dir/$RENAME_BINARY" >> $GITHUB_OUTPUT
137+
echo "SOLUNA_PATH=$bin_dir_output/$RENAME_BINARY" >> $GITHUB_OUTPUT
131138
echo "SOLUNA_BINARY=$RENAME_BINARY" >> $GITHUB_OUTPUT
132139
if [ "${{ runner.os }}" == "Linux" ]; then
133-
SOLUNA_WASM_PATH=$(find $bin_dir -name "soluna.wasm" | head -n 1)
134-
SOLUNA_JS_PATH=$(find $bin_dir -name "soluna.js" | head -n 1)
140+
SOLUNA_WASM_PATH=$(find "$bin_dir" -name "soluna.wasm" | head -n 1)
141+
SOLUNA_JS_PATH=$(find "$bin_dir" -name "soluna.js" | head -n 1)
135142
echo "SOLUNA_WASM_PATH=$SOLUNA_WASM_PATH" >> $GITHUB_OUTPUT
136143
echo "SOLUNA_JS_PATH=$SOLUNA_JS_PATH" >> $GITHUB_OUTPUT
137144
if [ "${{ inputs.debug }}" == "true" ]; then
138-
SOLUNA_WASM_MAP_PATH=$(find $bin_dir -name "soluna.wasm.map" | head -n 1)
145+
SOLUNA_WASM_MAP_PATH=$(find "$bin_dir" -name "soluna.wasm.map" | head -n 1)
139146
echo "SOLUNA_WASM_MAP_PATH=$SOLUNA_WASM_MAP_PATH" >> $GITHUB_OUTPUT
140147
fi
141148
fi

.github/workflows/nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
outputs:
1919
proceed: ${{ steps.check.outputs.proceed }}
2020
steps:
21-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
2424
- name: Get the last nightly commit
@@ -71,7 +71,7 @@ jobs:
7171
matrix:
7272
os: [windows-latest, macos-latest, ubuntu-latest]
7373
steps:
74-
- uses: actions/checkout@v5
74+
- uses: actions/checkout@v6
7575
with:
7676
submodules: recursive
7777
- uses: ./.github/actions/soluna
@@ -105,7 +105,7 @@ jobs:
105105
permissions:
106106
contents: write
107107
steps:
108-
- uses: actions/checkout@v5
108+
- uses: actions/checkout@v6
109109
- name: Download all artifacts
110110
uses: actions/download-artifact@v5
111111
with:

.github/workflows/pages.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,59 +24,44 @@ jobs:
2424
runs-on: ubuntu-latest
2525
concurrency:
2626
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref }}
27+
permissions:
28+
contents: read
29+
pages: write
30+
id-token: write
2731
steps:
28-
- uses: actions/checkout@v5
32+
- uses: actions/checkout@v6
2933
with:
3034
submodules: recursive
3135
fetch-depth: 0
3236
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
3337

34-
- name: Build Soluna (WASM)
38+
- name: Build Soluna
3539
uses: ./.github/actions/soluna
3640
id: build
3741
with:
3842
soluna_path: "."
3943
debug: ${{ github.event.inputs.debug }}
4044

41-
- name: Build WASM side module (sample)
45+
- name: Build Sample
4246
uses: ./.github/actions/sample
4347
id: sample
4448
with:
4549
soluna_path: "."
4650

47-
- name: Install web build tools
48-
run: |
49-
sudo apt-get update
50-
sudo apt-get install -y lua5.4 zip
51-
52-
- name: Prepare web assets
53-
run: |
54-
lua5.4 script/build_web.lua \
55-
--soluna . \
56-
--site web \
57-
--wasm "${{ steps.build.outputs.SOLUNA_WASM_PATH }}" \
58-
--js "${{ steps.build.outputs.SOLUNA_JS_PATH }}"
59-
if [ -f "${{ steps.build.outputs.SOLUNA_WASM_MAP_PATH }}" ]; then
60-
cp "${{ steps.build.outputs.SOLUNA_WASM_MAP_PATH }}" web/static/runtime/soluna.wasm.map
61-
fi
62-
63-
- name: Copy WASM side module into runtime
64-
run: |
65-
cp "${{ steps.sample.outputs.SAMPLE_WASM_PATH }}" web/static/runtime/sample.wasm
66-
67-
- name: Setup Hugo
68-
uses: peaceiris/actions-hugo@v3
69-
with:
70-
hugo-version: "0.154.5"
71-
72-
- name: Build
73-
run: hugo --source web --minify
74-
75-
- name: Upload static files as artifact
76-
id: deployment
77-
uses: actions/upload-pages-artifact@v3
51+
- name: Build Astro
52+
uses: withastro/action@v6
53+
env:
54+
SITE_BASE: /soluna/
55+
SOLUNA_JS_PATH: ${{ steps.build.outputs.SOLUNA_JS_PATH }}
56+
SOLUNA_WASM_PATH: ${{ steps.build.outputs.SOLUNA_WASM_PATH }}
57+
SOLUNA_WASM_MAP_PATH: ${{ steps.build.outputs.SOLUNA_WASM_MAP_PATH }}
58+
SAMPLE_WASM_PATH: ${{ steps.sample.outputs.SAMPLE_WASM_PATH }}
7859
with:
79-
path: web/public
60+
path: website
61+
node-version: 24
62+
package-manager: pnpm@10.28.2
63+
build-cmd: pnpm run build
64+
out-dir: dist
8065

8166
deploy:
8267
name: Deploy to GitHub Pages

.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
bin
22
build
3-
web/public
4-
web/data
5-
web/static/runtime
6-
web/static/data
7-
web/content/examples/*.md
8-
!web/content/examples/_index.md
3+
node_modules
4+
.pnpm-store
5+
pnpm-debug.log*
6+
website/node_modules
7+
website/packages/*/node_modules
8+
website/dist
9+
website/.astro
10+
website/public/runtime/

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ A framework you can use to make 2D games in Lua with multithreading, living on W
1414

1515
It is built on top of [sokol](https://github.com/floooh/sokol) and leverages the power of ltask for multithreading.
1616

17-
[![Nightly](/../../actions/workflows/nightly.yml/badge.svg)](/../../actions/workflows/nightyly.yml)
17+
[![Nightly](/../../actions/workflows/nightly.yml/badge.svg)](/../../actions/workflows/nightly.yml)
1818

1919
## Documentation
2020

2121
- [API Reference](./docs)
2222
- [Examples](./test)
2323
- [Wiki](https://github.com/cloudwu/soluna/wiki)
24+
- [Website](./website/README.md)
2425

2526
## Precompiled Binaries
2627

@@ -33,7 +34,7 @@ You can build Soluna from source by `make` for Windows and by `luamake` for all
3334
### Integration with the Actions of your projects
3435

3536
```yaml
36-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
3738
with:
3839
repository: cloudwu/soluna
3940
ref: <a fixed commit hash to avoid breaking changes>

README.zh-CN.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ Sokol + Lua = Soluna
1414

1515
Soluna 可以运行在 Windows、Linux、macOS 和现代浏览器(通过 WebAssembly)上。
1616

17-
[![Nightly](/../../actions/workflows/nightly.yml/badge.svg)](/../../actions/workflows/nightyly.yml)
17+
[![Nightly](/../../actions/workflows/nightly.yml/badge.svg)](/../../actions/workflows/nightly.yml)
1818

1919
## 文档
2020

2121
- [API 参考](./docs)
2222
- [示例](./test)
2323
- [Wiki](https://github.com/cloudwu/soluna/wiki)
24+
- [演示网站说明](./website/README.zh-CN.md)
2425

2526
## 预编译二进制文件
2627

@@ -35,7 +36,7 @@ WebAssembly 的预编译二进制文件。
3536
### 在你的项目的 Actions 中集成
3637

3738
```yaml
38-
- uses: actions/checkout@v5
39+
- uses: actions/checkout@v6
3940
with:
4041
repository: cloudwu/soluna
4142
ref: <a fixed commit hash to avoid breaking changes>

0 commit comments

Comments
 (0)