Skip to content

Commit cdf10fd

Browse files
committed
update build action
1 parent 7ec1070 commit cdf10fd

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,55 @@ on:
55
tags:
66
- "*"
77

8-
env:
9-
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
10-
118
jobs:
129
build:
13-
name: Build my project
10+
name: Build for ${{ matrix.targetPlatform }}
1411
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
targetPlatform:
16+
- StandaloneOSX
17+
- StandaloneWindows
18+
- StandaloneWindows64
19+
- StandaloneLinux64
20+
- WebGL
1521
steps:
1622
# Checkout
1723
- name: Checkout repository
1824
uses: actions/checkout@v2
1925
with:
26+
fetch-depth: 0
2027
lfs: true
2128

2229
# Cache
2330
- uses: actions/cache@v2
2431
with:
2532
path: Library
26-
key: Library
27-
28-
# Test
29-
- name: Run tests
30-
uses: game-ci/unity-test-runner@v2
31-
with:
32-
unityVersion: 2020.3.23f1
33+
key: Library-${{ matrix.targetPlatform }}
34+
restore-keys: Library-
3335

3436
# Build
35-
- name: Build project
36-
uses: game-ci/unity-builder@v2
37+
- uses: game-ci/unity-builder@v2
38+
env:
39+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
3740
with:
38-
unityVersion: 2020.3.23f1
39-
targetPlatform: StandaloneWindows64
41+
targetPlatform: ${{ matrix.targetPlatform }}
4042

4143
# Output
4244
- uses: actions/upload-artifact@v2
4345
with:
44-
name: Build
45-
path: build
46+
name: Build-${{ matrix.targetPlatform }}
47+
path: build/${{ matrix.targetPlatform }}
4648

4749
- name: Zip build
4850
run: |
49-
pushd build/StandaloneWindows64
50-
zip -r ../../StandaloneWindows64.zip .
51+
pushd build/${{ matrix.targetPlatform }}
52+
zip -r ../../${{ matrix.targetPlatform }}.zip .
5153
popd
5254
5355
- name: Release
5456
uses: softprops/action-gh-release@v1
5557
with:
56-
files: StandaloneWindows64.zip
57-
name: Release ${{ github.ref }}
58+
files: ${{ matrix.targetPlatform }}.zip
59+
name: Release ${{ github.ref }}

0 commit comments

Comments
 (0)