diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5774718..f1e347d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,20 +11,25 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-10.15, windows-2019] + name: ['macOS stable', 'iOS stable', 'Windows stable'] include: - - name: MacOS Stable + - name: macOS stable os: macos-10.15 - key: macos - - name: Windows Stable + target: x86_64-apple-darwin + - name: iOS stable + os: macos-10.15 + target: aarch64-apple-ios + - name: Windows stable os: windows-2019 - key: windows + target: x86_64-pc-windows-msvc steps: - uses: actions/checkout@v2 - if: matrix.os == 'windows-2019' name: Install make run: choco install make - - run: make gfx-portability.zip + - run: rustup target add ${{ matrix.target }} + - name: Build + run: make CARGO_BUILD_TARGET=${{ matrix.target }} gfx-portability.zip - name: Upload builds id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -33,5 +38,5 @@ jobs: with: upload_url: ${{ github.event.release.upload_url }} asset_path: ./gfx-portability.zip - asset_name: gfx-portability-${{ matrix.key }}-${{ github.event.release.tag_name }}.zip + asset_name: gfx-portability-${{ github.event.release.tag_name }}.${{ matrix.target }}.zip asset_content_type: application/zip diff --git a/Makefile b/Makefile index 24da743..0843742 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,12 @@ CFLAGS=-std=c++11 -ggdb -O0 -Iheaders DEPS= LDFLAGS= +ifeq ($(CARGO_BUILD_TARGET),) + JSON_SUFFIX=$(OS_NAME)-* +else + JSON_SUFFIX=$(CARGO_BUILD_TARGET) +endif + ifeq ($(OS),Windows_NT) LDFLAGS= BACKEND=dx12 @@ -56,6 +62,7 @@ else DEBUGGER=rust-lldb -- LIB_FILE_NAME=libportability.dylib LIB_VULKAN_NAME=libvulkan.dylib + #TODO: find a more idiomatic way to pass this arguments! CLINK_ARGS=-- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0" OS_NAME=macos endif @@ -175,7 +182,7 @@ gfx-portability.zip: version-debug version-release cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND) cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND) --release echo "$(GIT_TAG_FULL)" > commit-sha - $(ZIP_COMMAND) gfx-portability.zip target/*/$(LIB_FILE_NAME) libportability-icd/portability-$(OS_NAME)-*.json commit-sha + $(ZIP_COMMAND) gfx-portability.zip target/$(CARGO_BUILD_TARGET)/*/$(LIB_FILE_NAME) libportability-icd/portability-$(JSON_SUFFIX).json commit-sha target/debug/$(LIB_VULKAN_NAME): cd target/debug && ln -sf $(LIB_FILE_NAME) $(LIB_VULKAN_NAME) diff --git a/libportability-icd/portability-aarch64-apple-ios.json b/libportability-icd/portability-aarch64-apple-ios.json new file mode 100644 index 0000000..441d79c --- /dev/null +++ b/libportability-icd/portability-aarch64-apple-ios.json @@ -0,0 +1,7 @@ +{ + "file_format_version": "1.0.0", + "ICD": { + "library_path": "../target/aarch64-apple-ios/release/libportability_icd.dylib", + "api_version": "1.0.0" + } +} diff --git a/libportability-icd/portability-x86_64-apple-darwin.json b/libportability-icd/portability-x86_64-apple-darwin.json new file mode 100644 index 0000000..62bfca9 --- /dev/null +++ b/libportability-icd/portability-x86_64-apple-darwin.json @@ -0,0 +1,7 @@ +{ + "file_format_version": "1.0.0", + "ICD": { + "library_path": "../target/x86_64-apple-darwin/release/libportability_icd.dylib", + "api_version": "1.0.0" + } +} diff --git a/libportability-icd/portability-x86_64-pc-windows-msvc.json b/libportability-icd/portability-x86_64-pc-windows-msvc.json new file mode 100644 index 0000000..50b7744 --- /dev/null +++ b/libportability-icd/portability-x86_64-pc-windows-msvc.json @@ -0,0 +1,7 @@ +{ + "file_format_version": "1.0.0", + "ICD": { + "library_path": "..\\target\\x86_64-pc-windows-msvc\\release\\portability_icd.dll", + "api_version": "1.0.0" + } +}