diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 308514c9..e9022b1d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -30,7 +30,7 @@ on: jobs: # ----- - iOS: + ios: # Config name: release - ${{ matrix.name }} runs-on: macos-latest @@ -38,11 +38,11 @@ jobs: fail-fast: true matrix: include: - - name: iOS-aarch64 + - name: ios-aarch64 target: aarch64-apple-ios - - name: iOS-aarch64-simulator + - name: ios-aarch64-simulator target: aarch64-apple-ios-sim - - name: iOS-x86_64-simulator + - name: ios-x86_64-simulator target: x86_64-apple-ios env: TARGET: ${{ matrix.target }} @@ -59,7 +59,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: stable - - name: Add iOS targets + - name: Add ios targets run: rustup target add ${{ matrix.TARGET }} - name: Setup caching uses: Swatinem/rust-cache@v2 @@ -331,12 +331,11 @@ 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: - - iOS + - ios - android - linux - windows @@ -359,7 +358,7 @@ jobs: run: | echo $GITHUB_SHA > dist/commit-sha - name: Upload Release Assets - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.WGPU_NATIVE_VERSION }} name: ${{ env.WGPU_NATIVE_VERSION }} diff --git a/Makefile b/Makefile index cd408046..4b331701 100644 --- a/Makefile +++ b/Makefile @@ -45,20 +45,48 @@ endif package: lib-native lib-native-release mkdir -p dist - echo "$(GIT_TAG_FULL)" > dist/commit-sha + echo "Zipping the binaries ..." + 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; \ + cp ./ffi/webgpu-headers/webgpu.h dist/$$ARCHIVEDIR/include; \ + cp ./ffi/wgpu.h dist/$$ARCHIVEDIR/include; \ + if [ $(OS_NAME) = linux ]; then \ + cp ./$$LIBDIR/libwgpu_native.so dist/$$ARCHIVEDIR/lib; \ + cp ./$$LIBDIR/libwgpu_native.a dist/$$ARCHIVEDIR/lib; \ + fi; \ + if [ $(OS_NAME) = macos ]; then \ + cp ./$$LIBDIR/libwgpu_native.dylib dist/$$ARCHIVEDIR/lib; \ + cp ./$$LIBDIR/libwgpu_native.a dist/$$ARCHIVEDIR/lib; \ + fi; \ 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; \ + cp ./$$LIBDIR/wgpu_native.dll dist/$$ARCHIVEDIR/lib; \ + cp ./$$LIBDIR/libwgpu_native.a dist/$$ARCHIVEDIR/lib; \ + cp ./$$LIBDIR/libwgpu_native.dll.a dist/$$ARCHIVEDIR/lib; \ 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; \ + cp ./$$LIBDIR/wgpu_native.dll dist/$$ARCHIVEDIR/lib; \ + cp ./$$LIBDIR/wgpu_native.lib dist/$$ARCHIVEDIR/lib; \ + cp ./$$LIBDIR/wgpu_native.dll.lib dist/$$ARCHIVEDIR/lib; \ + cp ./$$LIBDIR/wgpu_native.pdb dist/$$ARCHIVEDIR/lib; \ + fi;\ + fi; \ + cd dist/$$ARCHIVEDIR; \ + if [ $(OS_NAME) = windows ]; then \ + 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; \ + cd ../..; \ + rm -r -f dist/$$ARCHIVEDIR; \ done clean: