Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add windows-gnu workflow #3314

Merged
merged 13 commits into from
Nov 18, 2022
64 changes: 63 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,59 @@ jobs:
if-no-files-found: error
retention-days: 2

windows_gnu:
name: Windows GNU
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install Windows-GNU linker
shell: bash
run: |
sudo apt install -y mingw-w64
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.61
target: x86_64-pc-windows-gnu
- name: Install Windows-GNU target
shell: bash
run: |
rustup target add x86_64-pc-windows-gnu
- name: Install Windows 10 SDK with xwin
shell: bash
run: |
mkdir -p /tmp/xwin
mkdir -p /tmp/xwindownload
mkdir -p /tmp/xwincache
git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin
cargo build --release --manifest-path=/tmp/xwin/Cargo.toml
/tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload
mkdir -p /tmp/winsdk
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/
echo "WinSDK files:"
ls -laH /tmp/winsdk
echo ""
mkdir -p package
mkdir -p package/winsdk
cp -r /tmp/winsdk/* package/winsdk
- name: Build Wasmer C-API without LLVM
shell: bash
run: |
cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load
- name: Dist
run: |
make distribution-gnu
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: 'wasmer-windows-gnu64'
path: dist
if-no-files-found: error
retention-days: 2

linux_aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
Expand Down Expand Up @@ -331,7 +384,7 @@ jobs:
retention-days: 2

release:
needs: [setup, build, linux_aarch64]
needs: [setup, build, linux_aarch64, windows_gnu]
runs-on: ubuntu-latest
if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != ''
steps:
Expand Down Expand Up @@ -385,6 +438,15 @@ jobs:
asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz
asset_name: wasmer-linux-aarch64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Windows gnu64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-windows-gnu64/wasmer.tar.gz
asset_name: wasmer-windows-gnu64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 (musl)
id: upload-release-asset-linux-musl-amd64
uses: actions/upload-release-asset@v1
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ api-docs-repo/
/wapm-cli/
/src/windows-installer/WasmerInstaller.exe
/lib/c-api/wasmer.h

.xwin-cache
# Generated by tests on Android
/avd
/core
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,38 @@ package-docs: build-docs build-docs-capi

package: package-wasmer package-minimal-headless-wasmer package-capi

package-gnu: package-capi-gnu

package-capi-gnu:
mkdir -p "package/include"
mkdir -p "package/lib"
cp lib/c-api/wasmer.h* package/include
cp lib/c-api/wasmer_wasm.h* package/include
cp lib/c-api/tests/wasm-c-api/include/wasm.h* package/include
cp lib/c-api/README.md package/include/README.md
if [ -f target/x86_64-pc-windows-gnu/release/wasmer.dll ]; then \
cp target/x86_64-pc-windows-gnu/release/wasmer.dll package/lib/wasmer.dll ;\
fi

if [ -f target/x86_64-pc-windows-gnu/release/wasmer.dll.lib ]; then \
cp target/x86_64-pc-windows-gnu/release/wasmer.dll.lib package/lib/wasmer.dll.lib ;\
fi

if [ -f target/x86_64-pc-windows-gnu/release/wasmer.lib ]; then \
cp target/x86_64-pc-windows-gnu/release/wasmer.lib package/lib/wasmer.lib ;\
fi

if [ -f target/x86_64-pc-windows-gnu/release/libwasmer.a ]; then \
cp target/x86_64-pc-windows-gnu/release/libwasmer.a package/lib/libwasmer.a ;\
fi

distribution-gnu: package-gnu
cp LICENSE package/LICENSE
cp ATTRIBUTIONS.md package/ATTRIBUTIONS
mkdir -p dist
tar -C package -zcvf wasmer.tar.gz lib include winsdk LICENSE ATTRIBUTIONS
mv wasmer.tar.gz dist/

distribution: package
cp LICENSE package/LICENSE
cp ATTRIBUTIONS.md package/ATTRIBUTIONS
Expand Down