Skip to content

Commit

Permalink
Apply folder structure to build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Sep 4, 2024
1 parent 3e18e3d commit b1a8018
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ jobs:
name: ${{ env.ARCHIVE_NAME }}

# Create a Github release and upload the binary libs that we just built.
# There should be a release and debug build for each platform (win32, win64, MacOS64, Linux64),
# plus a file containing the commit sha.
# There should be a release and debug build for each platform, plus a file containing the commit sha.
publish:
name: Publish Github release
needs:
Expand Down
32 changes: 23 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,34 @@ endif

package: lib-native lib-native-release
mkdir -p dist
echo "$(GIT_TAG_FULL)" > dist/commit-sha
echo "$(GIT_TAG_FULL)" > dist/wgpu-native-git-tag
for RELEASE in debug release; do \
ARCHIVE=$(ARCHIVE_NAME)-$$RELEASE.zip; \
ARCHIVEDIR=toarchive; \
ARCHIVEFILE=$(ARCHIVE_NAME)-$$RELEASE.zip; \
LIBDIR=$(TARGET_DIR)/$$RELEASE; \
rm -f dist/$$ARCHIVE; \
rm -r -f dist/$$ARCHIVEDIR; \
rm -f dist/$$ARCHIVEFILE; \
mkdir dist/$$ARCHIVEDIR; \
mkdir dist/$$ARCHIVEDIR/include; \
mkdir dist/$$ARCHIVEDIR/lib; \
cp ./dist/wgpu-native-git-tag dist/$$ARCHIVEDIR | true; \
cp ./ffi/webgpu-headers/webgpu.h dist/$$ARCHIVEDIR/include | true; \
cp ./ffi/wgpu.h dist/$$ARCHIVEDIR/include | true; \
cp ./$$LIBDIR/libwgpu_native.os dist/$$ARCHIVEDIR/lib | true; \
cp ./$$LIBDIR/libwgpu_native.dylib dist/$$ARCHIVEDIR/lib | true; \
cp ./$$LIBDIR/libwgpu_native.a dist/$$ARCHIVEDIR/lib | true; \
cp ./$$LIBDIR/libwgpu_native.dll.a dist/$$ARCHIVEDIR/lib | true; \
cp ./$$LIBDIR/wgpu_native.dll dist/$$ARCHIVEDIR/lib | true; \
cp ./$$LIBDIR/wgpu_native.lib dist/$$ARCHIVEDIR/lib | true; \
cp ./$$LIBDIR/wgpu_native.dll.lib dist/$$ARCHIVEDIR/lib | true; \
cp ./$$LIBDIR/wgpu_native.pdb dist/$$ARCHIVEDIR/lib | true; \
pushd dist/$$ARCHIVEDIR; \
if [ $(OS_NAME) = windows ]; then \
if [[ "$(TARGET)" == *"gnu"* ]]; then \
7z a -tzip dist/$$ARCHIVE ./$$LIBDIR/wgpu_native.dll ./$$LIBDIR/libwgpu_native.dll.a ./$$LIBDIR/libwgpu_native.a ./ffi/webgpu-headers/*.h ./ffi/wgpu.h ./dist/commit-sha; \
else \
7z a -tzip dist/$$ARCHIVE ./$$LIBDIR/wgpu_native.dll ./$$LIBDIR/wgpu_native.dll.lib ./$$LIBDIR/wgpu_native.pdb ./$$LIBDIR/wgpu_native.lib ./ffi/webgpu-headers/*.h ./ffi/wgpu.h ./dist/commit-sha; \
fi; \
7z a -tzip ../$$ARCHIVEFILE *; \
else \
zip -j dist/$$ARCHIVE ./$$LIBDIR/libwgpu_native.so ./$$LIBDIR/libwgpu_native.dylib ./$$LIBDIR/libwgpu_native.a ./ffi/webgpu-headers/*.h ./ffi/wgpu.h ./dist/commit-sha; \
zip -r ../$$ARCHIVEFILE *; \
fi; \
popd; \
done

clean:
Expand Down

0 comments on commit b1a8018

Please sign in to comment.