Skip to content

Commit

Permalink
update build action
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Dec 10, 2021
1 parent 7ec1070 commit cdf10fd
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,55 @@ on:
tags:
- "*"

env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
build:
name: Build my project
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneOSX
- StandaloneWindows
- StandaloneWindows64
- StandaloneLinux64
- WebGL
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true

# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library

# Test
- name: Run tests
uses: game-ci/unity-test-runner@v2
with:
unityVersion: 2020.3.23f1
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-

# Build
- name: Build project
uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
unityVersion: 2020.3.23f1
targetPlatform: StandaloneWindows64
targetPlatform: ${{ matrix.targetPlatform }}

# Output
- uses: actions/upload-artifact@v2
with:
name: Build
path: build
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}

- name: Zip build
run: |
pushd build/StandaloneWindows64
zip -r ../../StandaloneWindows64.zip .
pushd build/${{ matrix.targetPlatform }}
zip -r ../../${{ matrix.targetPlatform }}.zip .
popd
- name: Release
uses: softprops/action-gh-release@v1
with:
files: StandaloneWindows64.zip
name: Release ${{ github.ref }}
files: ${{ matrix.targetPlatform }}.zip
name: Release ${{ github.ref }}

0 comments on commit cdf10fd

Please # to comment.