|
35 | 35 | type: string |
36 | 36 | description: "Linux Swift static SDK version list (JSON)" |
37 | 37 | default: "[\"nightly-6.2\"]" |
| 38 | + wasm_sdk_versions: |
| 39 | + type: string |
| 40 | + description: "Swift Wasm SDK version list (JSON)" |
| 41 | + default: "[\"nightly-6.2\"]" |
38 | 42 | windows_swift_versions: |
39 | 43 | type: string |
40 | 44 | description: "Include Windows Swift version list (JSON)" |
|
59 | 63 | type: string |
60 | 64 | description: "Linux command to execute before building the Swift package with the static SDK" |
61 | 65 | default: "" |
| 66 | + wasm_sdk_pre_build_command: |
| 67 | + type: string |
| 68 | + description: "Linux command to execute before building the Swift package with the Wasm SDK" |
| 69 | + default: "" |
62 | 70 | macos_pre_build_command: |
63 | 71 | type: string |
64 | 72 | description: "macOS command to execute before building the Swift package" |
|
99 | 107 | type: boolean |
100 | 108 | description: "Boolean to enable building with the Linux static SDK. Defaults to false" |
101 | 109 | default: false |
| 110 | + enable_wasm_sdk_build: |
| 111 | + type: boolean |
| 112 | + description: "Boolean to enable building with the Wasm SDK. Defaults to false" |
| 113 | + default: false |
102 | 114 | enable_macos_checks: |
103 | 115 | type: boolean |
104 | 116 | description: "Boolean to enable macOS testing. Defaults to false" |
@@ -225,6 +237,44 @@ jobs: |
225 | 237 | curl -s --retry 3 https://raw.githubusercontent.com/jrflat/github-workflows/refs/heads/linux-static-sdk-build/.github/workflows/scripts/install-and-build-with-sdk.sh | \ |
226 | 238 | bash -s -- --static --flags "$BUILD_FLAGS" ${{ matrix.swift_version }} |
227 | 239 |
|
| 240 | + wasm-sdk-build: |
| 241 | + name: Wasm SDK Build (${{ matrix.swift_version }} - ${{ matrix.os_version }}) |
| 242 | + if: ${{ inputs.enable_wasm_sdk_build }} |
| 243 | + runs-on: ubuntu-latest |
| 244 | + strategy: |
| 245 | + fail-fast: false |
| 246 | + matrix: |
| 247 | + swift_version: ${{ fromJson(inputs.wasm_sdk_versions) }} |
| 248 | + os_version: ${{ fromJson(inputs.linux_os_versions) }} |
| 249 | + container: |
| 250 | + image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} |
| 251 | + steps: |
| 252 | + - name: Swift version |
| 253 | + run: swift --version |
| 254 | + - name: Checkout repository |
| 255 | + uses: actions/checkout@v4 |
| 256 | + - name: Provide token |
| 257 | + if: ${{ inputs.needs_token }} |
| 258 | + run: | |
| 259 | + echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV |
| 260 | + - name: Set environment variables |
| 261 | + if: ${{ inputs.linux_env_vars }} |
| 262 | + run: | |
| 263 | + for i in "${{ inputs.linux_env_vars }}" |
| 264 | + do |
| 265 | + printf "%s\n" $i >> $GITHUB_ENV |
| 266 | + done |
| 267 | + - name: Pre-build |
| 268 | + run: ${{ inputs.linux_pre_build_command }} |
| 269 | + - name: Install Wasm SDK and build |
| 270 | + env: |
| 271 | + BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} |
| 272 | + run: | |
| 273 | + ${{ inputs.wasm_sdk_pre_build_command }} |
| 274 | + which curl || (apt -q update && apt -yq install curl) |
| 275 | + curl -s --retry 3 https://raw.githubusercontent.com/jrflat/github-workflows/refs/heads/linux-static-sdk-build/.github/workflows/scripts/install-and-build-with-sdk.sh | \ |
| 276 | + bash -s -- --wasm --flags "$BUILD_FLAGS" ${{ matrix.swift_version }} |
| 277 | +
|
228 | 278 | windows-build: |
229 | 279 | name: Windows (${{ matrix.swift_version }} - windows-2022) |
230 | 280 | if: ${{ inputs.enable_windows_checks }} |
|
0 commit comments