File tree Expand file tree Collapse file tree 8 files changed +59
-7
lines changed Expand file tree Collapse file tree 8 files changed +59
-7
lines changed Original file line number Diff line number Diff line change 88
88
echo "::error::The formatting changed some files. Please run \`./Utilities/format.swift\` and commit the changes."
89
89
exit 1
90
90
}
91
+ build-examples :
92
+ runs-on : ubuntu-latest
93
+ steps :
94
+ - uses : actions/checkout@v4
95
+ - uses : ./.github/actions/install-swift
96
+ with :
97
+ download-url : https://download.swift.org/development/ubuntu2204/swift-DEVELOPMENT-SNAPSHOT-2025-06-12-a/swift-DEVELOPMENT-SNAPSHOT-2025-06-12-a-ubuntu22.04.tar.gz
98
+ - uses : swiftwasm/setup-swiftwasm@v2
99
+ id : setup-wasm32-unknown-wasi
100
+ with : { target: wasm32-unknown-wasi }
101
+ - uses : swiftwasm/setup-swiftwasm@v2
102
+ id : setup-wasm32-unknown-wasip1-threads
103
+ with : { target: wasm32-unknown-wasip1-threads }
104
+ - run : ./Utilities/build-examples.sh
105
+ env :
106
+ SWIFT_SDK_ID_wasm32_unknown_wasip1_threads : ${{ steps.setup-wasm32-unknown-wasip1-threads.outputs.swift-sdk-id }}
107
+ SWIFT_SDK_ID_wasm32_unknown_wasi : ${{ steps.setup-wasm32-unknown-wasi.outputs.swift-sdk-id }}
108
+ - name : Upload static files as artifact
109
+ id : deployment
110
+ uses : actions/upload-pages-artifact@v3
111
+ with :
112
+ path : Examples/
113
+ deploy-examples :
114
+ runs-on : ubuntu-latest
115
+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
116
+ environment :
117
+ name : github-pages
118
+ url : ${{ steps.deployment.outputs.page_url }}
119
+ needs : build-examples
120
+ steps :
121
+ - name : Deploy to GitHub Pages
122
+ id : deployment
123
+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 1
- swift package --swift-sdk " ${SWIFT_SDK_ID:- wasm32-unknown-wasip1-threads} " -c release \
1
+ #! /bin/bash
2
+ set -euxo pipefail
3
+ swift package --swift-sdk " ${SWIFT_SDK_ID_wasm32_unknown_wasip1_threads:- ${SWIFT_SDK_ID:- wasm32-unknown-wasip1-threads} } " -c release \
2
4
plugin --allow-writing-to-package-directory \
3
5
js --use-cdn --output ./Bundle
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- set -ex
3
- swift package --swift-sdk " ${SWIFT_SDK_ID:- wasm32-unknown-wasi} " -c " ${1:- debug} " js --use-cdn
2
+ set -euxo pipefail
3
+ swift package --swift-sdk " ${SWIFT_SDK_ID_wasm32_unknown_wasi :- ${ SWIFT_SDK_ID:- wasm32-unknown-wasi} } " -c " ${1:- debug} " js --use-cdn
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ set -euxo pipefail
2
3
package_dir=" $( cd " $( dirname " $0 " ) " && pwd) "
3
4
JAVASCRIPTKIT_EXPERIMENTAL_EMBEDDED_WASM=true \
4
5
swift package --package-path " $package_dir " \
Original file line number Diff line number Diff line change 1
- swift package --swift-sdk " ${SWIFT_SDK_ID:- wasm32-unknown-wasip1-threads} " -c release \
1
+ #! /bin/bash
2
+ set -euxo pipefail
3
+ swift package --swift-sdk " ${SWIFT_SDK_ID_wasm32_unknown_wasip1_threads:- ${SWIFT_SDK_ID:- wasm32-unknown-wasip1-threads} } " -c release \
2
4
plugin --allow-writing-to-package-directory \
3
5
js --use-cdn --output ./Bundle
Original file line number Diff line number Diff line change 1
- swift package --swift-sdk " ${SWIFT_SDK_ID:- wasm32-unknown-wasip1-threads} " -c release \
1
+ #! /bin/bash
2
+ set -euxo pipefail
3
+ swift package --swift-sdk " ${SWIFT_SDK_ID_wasm32_unknown_wasip1_threads:- ${SWIFT_SDK_ID:- wasm32-unknown-wasip1-threads} } " -c release \
2
4
plugin --allow-writing-to-package-directory \
3
5
js --use-cdn --output ./Bundle
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- set -ex
3
- swift package --swift-sdk " DEVELOPMENT-SNAPSHOT-2025-06-17-a- wasm32-unknown-wasi" -c " ${1:- debug} " js --use-cdn
2
+ set -euxo pipefail
3
+ env JAVASCRIPTKIT_EXPERIMENTAL_BRIDGEJS=1 swift package --swift-sdk " ${SWIFT_SDK_ID_wasm32_unknown_wasi :- ${SWIFT_SDK_ID :- wasm32-unknown-wasi} } " -c " ${1:- debug} " js --use-cdn
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ for example in Examples/* ; do
6
+ if [ -d " $example " ] && [ -f " $example /build.sh" ]; then
7
+ echo " Building $example "
8
+ set -x
9
+ (cd " $example " && ./build.sh release)
10
+ { set +x; } 2> /dev/null
11
+ fi
12
+ done
You can’t perform that action at this time.
0 commit comments