portability/.github/workflows/release.yml
2020-09-30 13:07:41 -04:00

59 lines
1.9 KiB
YAML

on:
release:
types: [published]
name: Release
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: ['macOS stable', 'iOS stable', 'Windows stable', 'UWP nightly']
include:
- name: macOS stable
os: macos-10.15
target: x86_64-apple-darwin
package: gfx-portability.zip
- name: iOS stable
os: macos-10.15
target: aarch64-apple-ios
package: gfx-portability.zip
- name: Windows stable
os: windows-2019
target: x86_64-pc-windows-msvc
package: gfx-portability.zip
- name: UWP nightly
os: windows-2019
target: x86_64-uwp-windows-msvc
package: gfx-portability-custom.zip
steps:
- uses: actions/checkout@v2
- if: matrix.os == 'windows-2019'
name: Install make
run: choco install make
- if: matrix.package == 'gfx-portability.zip'
name: Install target
run: rustup target add ${{ matrix.target }}
- if: matrix.package == 'gfx-portability-custom.zip'
name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
- name: Build
run: make CARGO_BUILD_TARGET=${{ matrix.target }} ${{ matrix.package }}
- name: Upload builds
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ matrix.package }}
asset_name: gfx-portability-${{ github.event.release.tag_name }}.${{ matrix.target }}.zip
asset_content_type: application/zip