-
-
Notifications
You must be signed in to change notification settings - Fork 5
193 lines (173 loc) · 6.19 KB
/
windows_workflow.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Windows workflow
on:
push:
branches:
- master
- develop
pull_request:
types:
- opened
branches:
- master
- develop
release:
types: [published]
jobs:
build_unity:
name: Build Unity project
runs-on: windows-2019
outputs:
buildVersion: ${{ steps.buildStep.outputs.buildVersion }}
steps:
# Activation stage
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: 'true'
- name: LFS pull
run: git lfs pull
- name: Set up IBM Watson credentials
env:
ASSISTANTKEYS: ${{ secrets.ASSISTANTKEYS }}
run: |
echo -n "$env:ASSISTANTKEYS" > $env:GITHUB_WORKSPACE/ibm-credentials.env
echo "path of the credentials resource $env:GITHUB_WORKSPACE/Assets/Resources/ibm-credentials.txt"
$env:IBM_CREDENTIALS_FILE="$env:GITHUB_WORKSPACE/ibm-credentials.env"
$env:TARGET_PLATFORM="Hololens"
# Cache
- name: Caching
uses: actions/cache@v3
with:
path: Library
key: Library-buildWindows-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-buildWindows-
# - name: Determine version manually
# run: |
# chmod +x ./ci/get_version.sh && APP_VERSION=`./ci/get_version.sh` && export APP_VERSION
# echo -n $APP_VERSION > version.txt
# Build stage
- name: Unity builder
uses: game-ci/[email protected]
id: buildStep
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_WINDOWS }}
with:
targetPlatform: WSAPlayer
unityVersion: 2021.3.8f1
versioning: Semantic
# dirty build needed to include generated Watson credentials
allowDirtyBuild: true
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: WSAPlayer
path: build/WSAPlayer
retention-days: 90
if-no-files-found: error
build_hololens:
name: Build Hololens
runs-on: windows-2019
needs: build_unity
outputs:
browser_download_url: ${{ steps.releaseUpload.outputs.browser_download_url }}
strategy:
fail-fast: false
matrix:
include:
- hlversion: 1
hlplatform: x86
- hlversion: 2
hlplatform: ARM64
env:
HLVERSION: ${{ matrix.hlversion }}
HLPLATFORM: ${{ matrix.hlplatform }}
JobID: ${{ github.event.release.body }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
lfs: 'true'
- name: LFS pull
run: git lfs pull
- name: Setup Unity UWP
uses: kuler90/setup-unity@v1
with:
unity-modules: universal-windows-platform
- name: Setup developer command prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Download WSAPlayer Artifact
uses: actions/download-artifact@v2
with:
name: WSAPlayer
path: build/WSAPlayer
- name: Execute msbuild
run: '& "msbuild.exe" build\WSAPlayer\WSAPlayer\MirageXR.sln -maxcpucount:2 /p:Configuration=Release /p:Platform=$env:HLPLATFORM /p:AppxBundle="Always" /p:AppxBundlePlatforms=$env:HLPLATFORM /p:UseSubFolderForOutputDirDuringMultiPlatformBuild=false'
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: hololens${{ matrix.hlversion }}
path: |
build/WSAPlayer/WSAPlayer/AppPackages/MirageXR/**/*.appxbundle
build/WSAPlayer/WSAPlayer/AppPackages/MirageXR/**/Dependencies/${{ matrix.hlplatform }}/*.appx
retention-days: 90
- name: Build zip for release only
uses: vimtor/action-zip@v1
if: github.event.release && github.event.action == 'published'
with:
files: |
build/WSAPlayer/WSAPlayer/AppPackages/MirageXR/**/*.appxbundle
build/WSAPlayer/WSAPlayer/AppPackages/MirageXR/**/Dependencies/${{ matrix.hlplatform }}/*.appx
dest: build/hololens${{ matrix.hlversion }}.zip
- name: Upload Zip to GitHub Release
uses: svenstaro/upload-release-action@v2
id: releaseUpload
if: github.event.release && github.event.action == 'published'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
asset_name: hololens${{ matrix.hlversion }}.zip
file: build/hololens${{ matrix.hlversion }}.zip
tag: ${{ github.ref }}
overwrite: false
body: ${{ github.event.release.body }}
# Deploy stage
prerelease-notification:
name: Prerelease Slack notification
runs-on: ubuntu-latest
needs: [build_unity, build_hololens]
if: github.ref == 'refs/heads/develop' && !github.event.pull_request
env:
SLACK_URL: ${{ secrets.SLACK_URL }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
APP_VERSION: ${{ needs.build_unity.outputs.buildVersion }}
TARGET_PLATFORM: $RUNNER_OS
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Post notification
run: |
echo $APP_VERSION
sudo apt-get update && sudo apt-get -y install curl
chmod +x ./ci/notify-preview.sh && ./ci/notify-preview.sh
release-notification:
name: Release Slack notification
runs-on: ubuntu-latest
needs: [build_unity, build_hololens]
if: github.event.release && github.event.action == 'published'
env:
SLACK_URL: ${{ secrets.SLACK_URL }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
APP_VERSION: ${{ needs.build_unity.outputs.buildVersion }}
DOWNLOAD_URL: ${{ needs.build_hololens.outputs.browser_download_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Post notification
run: |
echo $APP_VERSION
sudo apt-get update && sudo apt-get -y install curl
chmod +x ./ci/notify-release.sh && ./ci/notify-release.sh