Skip to content

Commit aeddc23

Browse files
ci: add Wasm preview deployment workflow
1 parent d44fe75 commit aeddc23

2 files changed

Lines changed: 78 additions & 1 deletion

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Pages Preview
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- gh-pages
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: pages-preview
14+
cancel-in-progress: true
15+
16+
jobs:
17+
deploy:
18+
name: Build and deploy Wasm preview
19+
if: github.ref_name == github.event.repository.default_branch
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Check out code
24+
uses: actions/checkout@v4
25+
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: zulu
30+
java-version: 17
31+
32+
- name: Set up Node.js 20
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 20
36+
37+
- name: Set up Yarn
38+
run: |
39+
npm install -g yarn
40+
yarn --version
41+
42+
- name: Install WASM dependencies
43+
run: |
44+
if [ -f "kotlin-js-store/wasm/yarn.lock" ]; then
45+
cd kotlin-js-store/wasm
46+
yarn install --frozen-lockfile
47+
cd ../..
48+
fi
49+
50+
- name: Setup Gradle
51+
uses: gradle/gradle-build-action@v2
52+
with:
53+
gradle-home-cache-cleanup: true
54+
55+
- name: Build Wasm distribution
56+
run: ./gradlew :composeApp:wasmJsBrowserDistribution --stacktrace
57+
58+
- name: Deploy to gh-pages
59+
uses: peaceiris/actions-gh-pages@v4
60+
with:
61+
github_token: ${{ secrets.GITHUB_TOKEN }}
62+
publish_branch: gh-pages
63+
publish_dir: ./composeApp/build/dist/wasmJs/productionExecutable
64+
force_orphan: true
65+
enable_jekyll: false
66+
commit_message: "docs: update Pages preview from ${{ github.sha }}"

settings.gradle.kts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ dependencyResolutionManagement {
2020
maven("https://maven.google.com/")
2121
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev/")
2222
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
23+
ivy("https://github.com/WebAssembly/binaryen/releases/download") {
24+
patternLayout {
25+
artifact("version_[revision]/binaryen-version_[revision]-[classifier].[ext]")
26+
}
27+
metadataSources {
28+
artifact()
29+
}
30+
content {
31+
includeModule("com.github.webassembly", "binaryen")
32+
}
33+
}
2334
}
2435
}
2536

@@ -28,4 +39,4 @@ includeBuild("convention-plugins")
2839
include(":composeApp")
2940
include(":data-saver-core")
3041
include(":data-saver-mmkv")
31-
include(":data-saver-data-store-preferences")
42+
include(":data-saver-data-store-preferences")

0 commit comments

Comments
 (0)