Last active
March 21, 2020 23:05
-
-
Save luke-biel/ae708a4b0fcba9eafb27382971720499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build project | |
on: | |
pull_request: {} | |
push: { branches: [master] } | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
jobs: | |
install-cross: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
depth: 50 | |
- uses: XAMPPRocky/get-github-release@v1 | |
id: cross | |
with: | |
owner: rust-embedded | |
repo: cross | |
matches: ${{ matrix.platform }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: cross-${{ matrix.platform }} | |
path: ${{ steps.cross.outputs.install_path }} | |
strategy: | |
matrix: | |
platform: | |
- linux-musl | |
- apple-darwin | |
lib_windows: | |
runs-on: windows-latest | |
needs: install-cross | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
depth: 50 | |
- run: chmod +x ci/* | |
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }} | |
- run: cargo build --target ${{ matrix.target }} --all-features --release | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: test-${{ matrix.target }}.dll | |
path: target/${{ matrix.target }}/release/test.dll | |
strategy: | |
fail-fast: true | |
matrix: | |
channel: | |
- stable | |
target: | |
- x86_64-pc-windows-msvc | |
lib_macos: | |
runs-on: macos-latest | |
needs: install-cross | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
depth: 50 | |
- uses: actions/download-artifact@v1 | |
with: | |
name: cross-apple-darwin | |
path: /usr/local/bin/ | |
- run: chmod +x /usr/local/bin/cross | |
- run: chmod +x ci/* | |
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }} | |
- run: ci/build.bash cross ${{ matrix.target }} RELEASE | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: libtest-${{ matrix.target }}.dylib | |
path: target/${{ matrix.target }}/release/libtest.dylib | |
strategy: | |
fail-fast: true | |
matrix: | |
channel: | |
- stable | |
target: | |
- x86_64-apple-darwin | |
lib_linux: | |
runs-on: ubuntu-latest | |
needs: install-cross | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
depth: 50 | |
- name: Download Cross | |
uses: actions/download-artifact@v1 | |
with: | |
name: cross-linux-musl | |
path: /tmp/ | |
- run: chmod +x /tmp/cross | |
- run: chmod +x ci/* | |
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }} | |
- run: ci/build.bash /tmp/cross ${{ matrix.target }} RELEASE | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: libtest-${{ matrix.target }}.so | |
path: target/${{ matrix.target }}/release/libtest.so | |
strategy: | |
fail-fast: true | |
matrix: | |
channel: | |
- stable | |
target: | |
- x86_64-unknown-linux-gnu | |
build_unity: | |
name: Build for ${{ matrix.targetPlatform.unity }} on version ${{ matrix.unityVersion }} | |
runs-on: ubuntu-latest | |
needs: | |
- lib_linux | |
- lib_windows | |
- lib_macos | |
strategy: | |
fail-fast: false | |
matrix: | |
projectPath: | |
- test_unity | |
unityVersion: | |
- 2019.3.5f1 | |
targetPlatform: | |
- unity: StandaloneOSX # Build a macOS standalone (Intel 64-bit). | |
lib: libtest-x86_64-apple-darwin.dylib | |
- unity: StandaloneWindows64 # Build a Windows 64-bit standalone. | |
lib: test-x86_64-pc-windows-msvc.dll | |
- unity: StandaloneLinux64 # Build a Linux 64-bit standalone. | |
lib: libtest-x86_64-unknown-linux-gnu.so | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Download lib | |
uses: actions/download-artifact@v1 | |
with: | |
name: ${{ matrix.targetPlatform.lib }} | |
path: test_unity/Assets/Plugins/ | |
- uses: actions/cache@v1.1.0 | |
with: | |
path: ${{ matrix.projectPath }}/Library | |
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform.unity }} | |
restore-keys: | | |
Library-${{ matrix.projectPath }}- | |
Library- | |
- uses: webbertakken/unity-builder@v0.11 | |
with: | |
projectPath: ${{ matrix.projectPath }} | |
unityVersion: ${{ matrix.unityVersion }} | |
targetPlatform: ${{ matrix.targetPlatform.unity }} | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: bin-${{ matrix.targetPlatform.unity }} | |
path: build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment