-
Notifications
You must be signed in to change notification settings - Fork 106
133 lines (115 loc) · 4.91 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build
run-name: Valkyrie build triggered by ${{ github.actor }}
on: [workflow_dispatch]
jobs:
Build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
#Get the version for build and store in environment variable for later use.
- name: Get version
run: echo "Build_Version=${${{ github.workspace }}/unity/Assets/Resources/version.txt}" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'corretto'
- name: Add msbuild to PATH
uses: microsoft/[email protected]
#Downloading and installing unity
#It should be possible to install more than one module at a time
#but it doesn't seem to work so the action has to be repeated for
#each module.
- name: Setup Unity and Linux Module
uses: kuler90/[email protected]
with:
unity-version: 2018.4.20f1
unity-modules: "linux"
install-path: "C:/Program Files"
- name: Setup Unity Mac Module
uses: kuler90/[email protected]
with:
unity-version: 2018.4.20f1
unity-modules: "mac-mono"
install-path: "C:/Program Files"
- name: Setup Unity Android Module
uses: kuler90/[email protected]
with:
unity-version: 2018.4.20f1
unity-modules: "android"
install-path: "C:/Program Files"
- name: Setup Unity IOS Module
uses: kuler90/[email protected]
with:
unity-version: 2018.4.20f1
unity-modules: "ios"
install-path: "C:/Program Files"
#Activate requires unity account creds for unity license checkout.
- name: Activate Unity
uses: kuler90/activate-unity@v1
with:
unity-username: ${{ secrets.UNITY_USERNAME }}
unity-password: ${{ secrets.UNITY_PASSWORD }}
unity-authenticator-key: ${{ secrets.UNITY_AUTHENTICATOR_KEY }}
#Move unity to where the build script expects it to be installed.
- name: Move unity to expected location
run: Rename-Item "C:/Program Files/2018.4.20f1" Unity
#Remove all pre-installed android sdk build tool versions except 28.0.3
- name: Remove unwanted android sdk build tool versions
run: Get-ChildItem -Path "C:/Android/android-sdk/build-tools" -Exclude 28.0.3,29.0.2 | Remove-Item -Recurse -Force
#Remove all pre-installed android sdk platform versions except 29
- name: Remove unwanted android sdk platform versions
run: Get-ChildItem -Path "C:/Android/android-sdk/platforms" -Exclude android-29 | Remove-Item -Recurse -Force
#Run build script
- name: Run build batch script
run: ${{ github.workspace }}/build.bat
- name: Archive windows unity build log
uses: actions/upload-artifact@v3
with:
name: windows-unity-build-log
path: ${{ github.workspace }}/build/Editor_valkyrie-windows.log
- name: Archive macos unity build log
uses: actions/upload-artifact@v3
with:
name: macos-unity-build-log
path: ${{ github.workspace }}/build/Editor_valkyrie-macos.log
- name: Archive linux unity build log
uses: actions/upload-artifact@v3
with:
name: linux-unity-build-log
path: ${{ github.workspace }}/build/Editor_valkyrie-linux.log
- name: Archive android unity build log
uses: actions/upload-artifact@v3
with:
name: android-unity-build-log
path: ${{ github.workspace }}/build/Editor_valkyrie-android.log
- name: Archive windows zip build
uses: actions/upload-artifact@v3
with:
name: windows-unity-build
path: ${{ github.workspace }}/build/valkyrie-windows-${{ env.Build_Version }}.zip
- name: Archive windows 7zip build
uses: actions/upload-artifact@v3
with:
name: windows-unity-build
path: ${{ github.workspace }}/build/valkyrie-windows-${{ env.Build_Version }}.7z
- name: Archive windows installer exe build
uses: actions/upload-artifact@v3
with:
name: windows-unity-build
path: ${{ github.workspace }}/build/valkyrie-windows-${{ env.Build_Version }}.exe
- name: Archive macos build
uses: actions/upload-artifact@v3
with:
name: macos-unity-build
path: ${{ github.workspace }}/build/valkyrie-macos-${{ env.Build_Version }}.tar.gz
- name: Archive linux build
uses: actions/upload-artifact@v3
with:
name: linux-unity-build
path: ${{ github.workspace }}/build/valkyrie-linux-${{ env.Build_Version }}.tar.gz
- name: Archive android build
uses: actions/upload-artifact@v3
with:
name: android-unity-build
path: ${{ github.workspace }}/build/Valkyrie-android-${{ env.Build_Version }}.apk