Skip to content

Commit

Permalink
ci: build for Windows msvc
Browse files Browse the repository at this point in the history
Unfortunately, `wash` cannot be built for mingw due to
rust-lang/rust#92212

Signed-off-by: Roman Volosatovs <[email protected]>
  • Loading branch information
rvolosatovs committed Oct 30, 2023
1 parent 0f967b0 commit abc0750
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ matrix.os }}-shared-cache"
Expand Down
34 changes: 25 additions & 9 deletions .github/workflows/wasmcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ jobs:
file ./result/bin/wasmcloud
test-oci: docker load < ./result

- target: x86_64-pc-windows-gnu
test-bin: |
nix profile install --inputs-from . 'nixpkgs#wine64'
wine64 ./result/bin/wash.exe --version
wine64 ./result/bin/wasmcloud.exe --version
test-oci: docker load < ./result
# TODO: Run win64 binary within OCI
# TODO: Build for GNU once https://github.com/rust-lang/rust/issues/92212 is resolved
#- target: x86_64-pc-windows-gnu
# test-bin: |
# nix profile install --inputs-from . 'nixpkgs#wine64'
# wine64 ./result/bin/wash.exe --version
# wine64 ./result/bin/wasmcloud.exe --version
# test-oci: docker load < ./result
# # TODO: Run win64 binary within OCI

- target: x86_64-unknown-linux-musl
test-bin: |
Expand All @@ -84,6 +85,20 @@ jobs:
package: wasmcloud-${{ matrix.config.target }}-oci
- run: ${{ matrix.config.test-oci }}

build-windows:
name: wasmcloud-x86_64-pc-windows-msvc
runs-on: windows-latest-8-cores
steps:
- uses: actions/[email protected]
- run: cargo build --release --workspace
- run: mkdir -p ./bin
- run: mv ./target/release/wasmcloud.exe ./bin/wasmcloud.exe
- run: mv ./target/release/wash.exe ./bin/wash.exe
- uses: actions/upload-artifact@v3
with:
name: wasmcloud-x86_64-pc-windows-msvc
path: bin

build-lipo:
name: wasmcloud-universal-darwin
needs: build-bin
Expand Down Expand Up @@ -127,11 +142,12 @@ jobs:

test-windows:
runs-on: windows-2022
needs: build-bin
needs: build-windows
steps:
- uses: actions/download-artifact@v3
with:
name: wasmcloud-x86_64-pc-windows-gnu
name: wasmcloud-x86_64-pc-windows-msvc
- run: .\bin\wash.exe --version
- run: .\bin\wasmcloud.exe --version

cargo:
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ RUN case ${TARGETPLATFORM} in \
"darwin/arm64") TARGET="aarch64-apple-darwin" ;; \
"linux/amd64") TARGET="x86_64-unknown-linux-musl" ;; \
"linux/arm64") TARGET="aarch64-unknown-linux-musl" ;; \
"windows/amd64") TARGET="x86_64-pc-windows-gnu" ;; \
*) \
echo "ERROR: TARGETPLATFORM '${TARGETPLATFORM}' not supported." \
exit 1 \
Expand Down
1 change: 0 additions & 1 deletion crates/wash-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ RUN case ${TARGETPLATFORM} in \
"darwin/arm64") TARGET="aarch64-apple-darwin" ;; \
"linux/amd64") TARGET="x86_64-unknown-linux-musl" ;; \
"linux/arm64") TARGET="aarch64-unknown-linux-musl" ;; \
"windows/amd64") TARGET="x86_64-pc-windows-gnu" ;; \
*) \
echo "ERROR: TARGETPLATFORM '${TARGETPLATFORM}' not supported." \
exit 1 \
Expand Down

0 comments on commit abc0750

Please sign in to comment.