gpu-dawn: dev: add Windows support for release bundling/upload

Helps hexops/mach#86

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-04 21:39:12 -07:00
parent d7eebaa645
commit ba0c0c9354
2 changed files with 14 additions and 4 deletions

View file

@ -18,7 +18,11 @@ popd
gzip -9 headers.json
# Copy the binary into the out/ directory
cp zig-out/lib/libdawn.a out/
if [[ "${WINDOWS:-"false"}" == "true" ]]; then
cp zig-out/lib/dawn.lib out/
else
cp zig-out/lib/libdawn.a out/
fi
# Create out.tar.gz bundle
pushd out

View file

@ -11,9 +11,15 @@ if [[ "${UPLOAD_HEADERS:-"false"}" == "true" ]]; then
fi
# Upload static library individually.
cp zig-out/lib/libdawn.a "libdawn_$RELEASE_NAME.a"
gzip -9 "libdawn_$RELEASE_NAME.a"
gh release upload "release-$(git rev-parse --short HEAD)" "libdawn_$RELEASE_NAME.a.gz"
if [[ "${WINDOWS:-"false"}" == "true" ]]; then
cp zig-out/lib/dawn.lib "dawn_$RELEASE_NAME.lib"
gzip -9 "dawn_$RELEASE_NAME.lib"
gh release upload "release-$(git rev-parse --short HEAD)" "dawn_$RELEASE_NAME.lib.gz"
else
cp zig-out/lib/libdawn.a "libdawn_$RELEASE_NAME.a"
gzip -9 "libdawn_$RELEASE_NAME.a"
gh release upload "release-$(git rev-parse --short HEAD)" "libdawn_$RELEASE_NAME.a.gz"
fi
# Upload tarball of static library + headers.
mv out.tar.gz "$RELEASE_NAME.tar.gz"