-
-
Notifications
You must be signed in to change notification settings - Fork 5
170 lines (157 loc) · 6.43 KB
/
linux_develop_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
name: Linux Develop Workflow (Unit tests and Android build)
on:
workflow_dispatch:
schedule:
- cron: 0 19 * * 5
jobs:
test:
name: Test Unity
runs-on: ubuntu-latest
steps:
# Activation stage
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: 'true'
ref: develop
- name: LFS pull
run: git lfs pull
- name: Set up credentials
env:
ASSISTANTKEYS: ${{ secrets.ASSISTANTKEYS }}
OAIKEYS: ${{ secrets.OAISECRET }}
SENTRYCFG: ${{ secrets.SENTRYCFG }}
SENTRYCLI: ${{ secrets.SENTRYCLI }}
run: |
echo -n "$ASSISTANTKEYS" > $GITHUB_WORKSPACE/ibm-credentials.env
echo "path of the credentials resource $GITHUB_WORKSPACE/ibm-credentials.txt"
export IBM_CREDENTIALS_FILE="$GITHUB_WORKSPACE/ibm-credentials.env"
echo -n "$OAIKEYS" > $GITHUB_WORKSPACE/Assets/Resources/openai.txt
echo "path of the OAI credentials resource $GITHUB_WORKSPACE/Assets/Resources/openai.txt"
echo -n "$SENTRYCFG" > $GITHUB_WORKSPACE/Assets/Resources/Sentry/SentryOptions.asset
echo "path of the Sentry options yaml file $GITHUB_WORKSPACE/Assets/Resources/Sentry/SentryOptions.asset"
echo -n "$SENTRYCLI" > $GITHUB_WORKSPACE/Assets/Plugins/Sentry/SentryCliOptions.asset
echo "path of the Sentry CLI options yaml file $GITHUB_WORKSPACE/Assets/Plugins/Sentry/SentryCliOptions.asset"
# Fonts
- name: Install fonts
run: |
echo -n "Installing core fonts"
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | sudo debconf-set-selections
echo "ttf-mscorefonts-installer msttcorefonts/present-mscorefonts-eula note" | sudo debconf-set-selections
sudo apt install ttf-mscorefonts-installer
sudo fc-cache -f
fc-match Arial
# Cache
- name: Caching
uses: actions/cache@v3
with:
path: Library
key: Library-linux-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-linux
# Test stage
- name: Unity Test runner (edit and play mode)
uses: game-ci/[email protected]
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: EditMode
githubToken: ${{ secrets.GITHUB_TOKEN }}
unityVersion: 2022.3.7f1
build:
name: Build Unity
runs-on: ubuntu-latest
needs: test
outputs:
buildVersion: ${{ steps.buildStep.outputs.buildVersion }}
steps:
# Free up disk space
- uses: jlumbroso/[email protected]
# Activation stage
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: 'true'
ref: develop
- name: LFS pull
run: git lfs pull
- name: Set up IBM Watson credentials
env:
ASSISTANTKEYS: ${{ secrets.ASSISTANTKEYS }}
OAIKEYS: ${{ secrets.OAISECRET }}
SENTRYCFG: ${{ secrets.SENTRYCFG }}
run: |
echo -n "$ASSISTANTKEYS" > $GITHUB_WORKSPACE/ibm-credentials.env
echo "path of the credentials resource $GITHUB_WORKSPACE/ibm-credentials.txt"
export IBM_CREDENTIALS_FILE="$GITHUB_WORKSPACE/ibm-credentials.env"
echo -n "$OAIKEYS" > $GITHUB_WORKSPACE/Assets/Resources/openai.txt
echo "path of the OAI credentials resource $GITHUB_WORKSPACE/Assets/Resources/openai.txt"
echo -n "$SENTRYCFG" > $GITHUB_WORKSPACE/Assets/Resources/Sentry/SentryOptions.asset
echo "path of the Sentry options yaml file $GITHUB_WORKSPACE/Assets/Resources/Sentry/SentryOptions.asset"
export TARGET_PLATFORM="Android"
# Fonts
- name: Install fonts
run: |
echo -n "Installing core fonts"
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | sudo debconf-set-selections
echo "ttf-mscorefonts-installer msttcorefonts/present-mscorefonts-eula note" | sudo debconf-set-selections
sudo apt install ttf-mscorefonts-installer
sudo fc-cache -f
fc-match Arial
# Cache
- name: Caching
uses: actions/cache@v3
with:
path: Library
key: Library-linux-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-linux
# Build stage
- name: Unity builder
uses: game-ci/unity-builder@v4
id: buildStep
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: Android
unityVersion: 2022.3.7f1
versioning: Semantic
# dirty build needed to include generated Watson credentials
allowDirtyBuild: true
androidExportType: androidPackage # for store upload change to 'androidAppBundle'
androidKeystoreName: miragexr # This file won't exist, but this property needs to exist.
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
androidTargetSdkVersion: AndroidApiLevel33
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: Android
path: build
retention-days: 3
if-no-files-found: error
# Deploy stage
prerelease-notification:
name: Prerelease Slack notification
runs-on: ubuntu-latest
needs: build
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.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