Skip to content

Commit

Permalink
gpu-dawn: dev: add Windows support for release bundling/upload
Browse files Browse the repository at this point in the history
Helps hexops/mach#86

Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
slimsag committed Mar 5, 2022
1 parent 79bc9a8 commit 07ab8e7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion dev/bundle-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions dev/upload-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 07ab8e7

Please sign in to comment.