-
Notifications
You must be signed in to change notification settings - Fork 1
260 lines (226 loc) · 8.3 KB
/
ci.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# workflow name
name: 🔨Build/📦Release/🚀Deploy
# fire on
on: [push, pull_request]
#########
# actions
#########
# actions/checkout@v4.1.4
# actions/download-artifact@v4.1.7
# actions/create-release@v1.1.4
# actions/upload-release-asset@v1.0.2
# benc-uk/workflow-dispatch@v1.2.3
# ./.github/actions/get-parent-dir
# ./.github/actions/install
# ./.github/actions/test
# stuff to do
jobs:
install-test:
name: 💿/⏱️
runs-on: ${{ matrix.os-name }}
strategy:
matrix:
os-name: [ubuntu-latest]
python-version: [3.8]
steps:
# checkout commit
- name: ✔️Checkout commit
uses: actions/checkout@v4.1.4
# install
- name: 💿Call Install
uses: ./.github/actions/install
with:
calling-job: test
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# Analyze used GitHub Actions
- name: ⚙️Analyze used GitHub Actions
shell: bash
run: |
python ./resources/ci/common/list_actions.py
# test
- name: ⏱️Call Test
uses: ./.github/actions/test
with:
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# Clean EmoPack workspace & prepare release
install-release-prepare:
name: 💿/📀->📦
runs-on: ${{ matrix.os-name }}
needs: [install-test]
strategy:
matrix:
# one OS
os-name: [ubuntu-latest]
python-version: [3.8]
steps:
# checkout commit
- name: ✔️Checkout commit
uses: actions/checkout@v4.1.4
# install
- name: 💿Call Install
uses: ./.github/actions/install
with:
calling-job: release-prepare
os-name: ${{ matrix.os-name }}
python-version: ${{ matrix.python-version }}
# get parent dir
- name: 📁Get Parent Directory
id: parentDir
uses: ./.github/actions/get-parent-dir
# Prepare AppVersion
- name: 💬Prepare AppVersion
run: |
python ./resources/ci/common/prepare_appversion.py
# Prepare Manifest
- name: 💬Prepare Manifest
run: |
python ./resources/ci/common/prepare_manifest.py
# Prepare Release
- name: 📀->📦Prepare Release
run: |
python ./resources/ci/common/prepare_release.py
# Cleanup Workspace
- name: 🧹Cleanup Workspace
run: |
python ./resources/ci/common/cleanup.py
# Upload AppVersion Artifact
- name: 🔼Upload AppVersion Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: appversion-${{ matrix.os-name }}
path: ${{ steps.parentDir.outputs.parentDir}}/build
# Upload Archive Artifact
- name: 🔼Upload Archive Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: archive-${{ matrix.os-name }}
path: ${{ steps.parentDir.outputs.parentDir}}/deploy
# Deploy to GitHub Releases
# Release Name: SpriteSomething v${GITHUB_TAG}
# Release Body: Inline content of RELEASENOTES.md
# Release Body: Fallback to URL to RELEASENOTES.md
# Release Files: ../deploy
release-deploy:
name: 📀->🚀
runs-on: ${{ matrix.os-name }}
# VM settings
# os & python versions
strategy:
matrix:
# release only on ubuntu
os-name: [ubuntu-latest]
python-version: [3.8]
needs: [install-release-prepare]
steps:
# checkout commit
- name: ✔️Checkout commit
uses: actions/checkout@v4.1.4
# install dependencies via pip
- name: 💿Install Dependencies via pip
shell: bash
run: |
python -m pip install pytz requests
# get parent dir
- name: 📁Get Parent Directory
id: parentDir
uses: ./.github/actions/get-parent-dir
# download appversion artifact
- name: 🔽Download AppVersion Artifact
uses: actions/download-artifact@v4.1.7
with:
name: appversion-${{ matrix.os-name }}
path: ${{ steps.parentDir.outputs.parentDir }}/build
# download archive artifact
- name: 🔽Download Archive Artifact
uses: actions/download-artifact@v4.1.7
with:
name: archive-${{ matrix.os-name }}
path: ${{ steps.parentDir.outputs.parentDir }}/deploy
# debug info
- name: 📝Debug Info
id: debug_info
# shell: bash
# git tag ${GITHUB_TAG}
# git push origin ${GITHUB_TAG}
run: |
PROJECT_NAME="Axiom Verge Emotracker Pack"
echo "project_name=$PROJECT_NAME" >> $GITHUB_OUTPUT
GITHUB_TAG="$(head -n 1 ../build/app_version.txt)"
echo "github_tag=$GITHUB_TAG" >> $GITHUB_OUTPUT
RELEASE_NAME="${PROJECT_NAME} ${GITHUB_TAG}"
echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT
ASSET_PREFIX="${PROJECT_NAME}-${GITHUB_TAG}"
echo "asset_prefix=$ASSET_PREFIX" >> $GITHUB_OUTPUT
echo "Project Name: ${PROJECT_NAME}"
echo "Release Name: ${RELEASE_NAME}"
echo "Asset Prefix: ${ASSET_PREFIX}"
echo "Git Tag: ${GITHUB_TAG}"
# create a release
- name: 📀->🚀Create a Release (MASTER)
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.debug_info.outputs.github_tag }}
release_name: Axiom Verge EmoTracker Pack v${{ steps.debug_info.outputs.github_tag }}
body_path: RELEASENOTES.md
# draft: true
if: contains(github.ref, 'master')
# upload archive asset
- name: 🔼Upload Archive Asset (MASTER)
id: upload-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../deploy/averge_pack_mm1.zip
asset_name: averge_pack_mm1.zip
asset_content_type: application/zip
if: contains(github.ref, 'master')
# Update Pack Listing
update-packlisting:
name: 📝Update Pack Listing
runs-on: ${{ matrix.os-name }}
# VM settings
# os & python versions
strategy:
matrix:
# run only on ubuntu
os-name: [ubuntu-latest]
python-version: [3.8]
needs: [release-deploy]
steps:
# checkout commit
- name: ✔️Checkout commit
uses: actions/checkout@v4.1.4
- name: 💿Install Dependencies via pip
run: |
python -m pip install pytz requests
# get packlisting destination
- name: Get Pack Listing Destination
id: packlisting
run: |
PACKLISTING_USERNAME="$([[ $(head -n 1 ./resources/app/meta/manifests/repository.txt) =~ ([^\/]*)\/([^:]*)\:(.*) ]] && echo ${BASH_REMATCH[1]})"
echo "packlisting_username=$PACKLISTING_USERNAME" >> $GITHUB_OUTPUT
PACKLISTING_REPOSITORY="$([[ $(head -n 1 ./resources/app/meta/manifests/repository.txt) =~ ([^\/]*)\/([^:]*)\:(.*) ]] && echo ${BASH_REMATCH[2]})"
echo "packlisting_repository=$PACKLISTING_REPOSITORY" >> $GITHUB_OUTPUT
PACKLISTING_BRANCH="$([[ $(head -n 1 ./resources/app/meta/manifests/repository.txt) =~ ([^\/]*)\/([^:]*)\:(.*) ]] && echo ${BASH_REMATCH[3]})"
echo "packlisting_branch=$PACKLISTING_BRANCH" >> $GITHUB_OUTPUT
echo "Pack Listing Username: $PACKLISTING_USERNAME"
echo "Pack Listing Repository: $PACKLISTING_REPOSITORY"
echo "Pack Listing Branch: $PACKLISTING_BRANCH"
echo "Pack Listing Destination: $PACKLISTING_USERNAME/$PACKLISTING_REPOSITORY@refs/heads/$PACKLISTING_BRANCH"
# Update EmoTracker Pack Repository
- name: Update EmoTracker Pack Repository (MASTER)
id: update-pack-repo-benc
uses: benc-uk/workflow-dispatch@v1.2.3
with:
workflow: ci.yml
repo: ${{ steps.packlisting.outputs.packlisting_username }}/${{ steps.packlisting.outputs.packlisting_repository }}
ref: ${{ steps.packlisting.outputs.packlisting_branch }}
token: ${{ secrets.MY_PAT }}
if: contains(github.ref, 'master') || contains(github.ref, 'unstable')