diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 308514c9..9b808fe4 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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: diff --git a/Makefile b/Makefile index cd408046..b89fc74a 100644 --- a/Makefile +++ b/Makefile @@ -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: