-
-
Notifications
You must be signed in to change notification settings - Fork 5
140 lines (128 loc) · 4.47 KB
/
linux_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
name: Linux Workflow (Unit tests and Android build)
on:
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'
- name: LFS pull
run: git lfs pull
- name: Set up IBM Watson credentials
env:
ASSISTANTKEYS: ${{ secrets.ASSISTANTKEYS }}
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"
# 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_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
unityVersion: 2021.3.8f1
build:
name: Build Unity
runs-on: ubuntu-latest
needs: test
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 "$ASSISTANTKEYS" > $GITHUB_WORKSPACE/ibm-credentials.env
ls -la
echo "path of the credentials resource $GITHUB_WORKSPACE/ibm-credentials.txt"
export IBM_CREDENTIALS_FILE="$GITHUB_WORKSPACE/ibm-credentials.env"
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/[email protected]
id: buildStep
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: Android
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: 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