Skip to content

Commit a76e00f

Browse files
committed
Build artifacts for Wasmtime & Wasmer runtimes
1 parent dce5032 commit a76e00f

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

.github/workflows/addon.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
platform: [linux, macos, windows]
19+
runtime: [wasmtime, wasmer]
1920
include:
2021
- platform: linux
2122
os: ubuntu-latest
@@ -45,11 +46,12 @@ jobs:
4546
platform: ${{ matrix.platform }}
4647
target: ${{ env.TARGET }}
4748
cache-suffix: ${{ env.GODOT_REF }}
49+
scons-flags: "wasm_runtime=${{ matrix.runtime }}"
4850

4951
- name: Upload Artifact
5052
uses: actions/upload-artifact@v4
5153
with:
52-
name: ${{ matrix.platform }}
54+
name: ${{ matrix.platform }}-${{ matrix.runtime }}
5355
path: ${{ github.workspace }}/${{ env.LIBRARY_PATH }}/${{ matrix.platform }}
5456
if-no-files-found: error
5557

@@ -60,6 +62,7 @@ jobs:
6062
fail-fast: false
6163
matrix:
6264
platform: [linux, macos, windows]
65+
runtime: [wasmtime, wasmer]
6366
include:
6467
- platform: linux
6568
os: ubuntu-latest
@@ -82,7 +85,7 @@ jobs:
8285
- name: Download Addon
8386
uses: actions/download-artifact@v4
8487
with:
85-
name: ${{ matrix.platform }}
88+
name: ${{ matrix.platform }}-${{ matrix.runtime }}
8689
path: ${{ github.workspace }}/${{ env.LIBRARY_PATH }}/${{ matrix.platform }}
8790

8891
- name: Run Tests
@@ -97,6 +100,7 @@ jobs:
97100
fail-fast: false
98101
matrix:
99102
platform: [linux, macos, windows]
103+
runtime: [wasmtime, wasmer]
100104
include:
101105
- platform: linux
102106
os: ubuntu-latest
@@ -119,7 +123,7 @@ jobs:
119123
- name: Download Addon
120124
uses: actions/download-artifact@v4
121125
with:
122-
name: ${{ matrix.platform }}
126+
name: ${{ matrix.platform }}-${{ matrix.runtime }}
123127
path: ${{ github.workspace }}/${{ env.LIBRARY_PATH }}/${{ matrix.platform }}
124128

125129
- name: Export Tests

.github/workflows/release.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,49 @@ jobs:
1111
release:
1212
name: Release
1313
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
runtime: [wasmtime, wasmer]
1418
steps:
1519
- name: Checkout
1620
uses: actions/checkout@v4
1721

1822
- name: Clean Binaries
1923
run: find ${{ github.workspace }}/${{ env.LIBRARY_PATH }} -mindepth 1 -type d -exec rm -rf {} +
2024

25+
# Non-standard download action required for cross-workflow downloads
2126
- name: Download Artifact
22-
# Non-standard download action required for cross-workflow downloads
23-
uses: dawidd6/action-download-artifact@v6
27+
uses: dawidd6/action-download-artifact@v11
2428
with:
2529
workflow: addon.yml
2630
commit: ${{ github.sha }}
31+
name: \w+-${{ matrix.runtime }}
32+
name_is_regexp: true
2733
path: ${{ github.workspace }}/${{ env.LIBRARY_PATH }}
2834

35+
# Artifacts are placed in directories matching their names i.e. with runtime suffix
36+
- name: Strip Runtime Suffix
37+
run: |
38+
cd ${{ github.workspace }}/${{ env.LIBRARY_PATH }}
39+
for dir in */; do
40+
if [ -d "$dir" ]; then
41+
dirname="${dir%/}"
42+
newname="${dirname%-${{ matrix.runtime }}}"
43+
if [ "$dirname" != "$newname" ]; then
44+
mv "$dirname" "$newname"
45+
fi
46+
fi
47+
done
48+
2949
- name: Prepare Asset
3050
run: |
3151
mkdir godot-wasm
3252
mv addons godot-wasm
3353
cd ${{ github.workspace }}
34-
zip -r ${{ env.RELEASE_ASSET }} godot-wasm
54+
zip -r asset-library-${{ matrix.runtime }}.zip godot-wasm
3555
3656
- name: Create Release
3757
uses: softprops/action-gh-release@v2
3858
with:
39-
files: ${{ github.workspace }}/${{ env.RELEASE_ASSET }}
59+
files: ${{ github.workspace }}/asset-library-${{ matrix.runtime }}.zip

0 commit comments

Comments
 (0)