Update build.yml #139
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 Windows Player and Android APK | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
buildPlayer: | |
name: build Player | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
buildName: | |
- UmaViewer | |
projectPath: | |
- ./ | |
unityVersion: | |
- 2020.3.24f1 | |
targetPlatform: | |
- StandaloneWindows64 # Build a Windows 64-bit standalone. | |
- Android # Build an Android APK. | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- uses: game-ci/unity-builder@v2 | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
buildName: ${{ matrix.buildName }} | |
projectPath: ${{ matrix.projectPath }} | |
unityVersion: ${{ matrix.unityVersion }} | |
targetPlatform: ${{ matrix.targetPlatform }} | |
- name: Zip Binary | |
if: matrix.targetPlatform == 'StandaloneWindows64' | |
run: zip -r UmaViewer_${{ matrix.targetPlatform }}.zip build/${{ matrix.targetPlatform }}/* | |
- name: Create Release | |
if: matrix.targetPlatform == 'StandaloneWindows64' | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
tag_name: AutoBuild_${{ github.event.head_commit.id }} | |
release_name: UmaViewer_${{ github.event.head_commit.id }} | |
draft: false | |
prerelease: false | |
- name: Upload Windows Release Asset | |
if: matrix.targetPlatform == 'StandaloneWindows64' | |
id: upload-windows-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./UmaViewer_${{ matrix.targetPlatform }}.zip | |
asset_name: UmaViewer.zip | |
asset_content_type: application/zip | |
- name: Upload Android Release Asset | |
if: matrix.targetPlatform == 'Android' | |
id: upload-android-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./build/${{ matrix.targetPlatform }}/UmaViewer.apk | |
asset_name: UmaViewer.apk | |
asset_content_type: application/vnd.android.package-archive |