-
Notifications
You must be signed in to change notification settings - Fork 4
290 lines (290 loc) · 12 KB
/
build_multi.yaml
File metadata and controls
290 lines (290 loc) · 12 KB
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
name: build all platforms
# Trigger the workflow when a push event happens on the versioning branch
on:
push:
branches: [ build_multi, site ]
# Define environment variables
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET }}
# Define jobs to run
jobs:
# Create a release
create_release:
if: github.ref == 'refs/heads/build_multi'
# Define output variables
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# Define permissions
permissions: write-all
# Define the operating system to run on
runs-on: ubuntu-20.04
# Define steps to run
steps:
# Checkout the code
- uses: actions/checkout@v2
# Set the VERSION environment variable to the contents of the VERSION file
- run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
# Create a GitHub release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: v${{ env.VERSION }}
draft: false
prerelease: false
# Build the macOS release
build_macosx:
if: github.ref == 'refs/heads/build_multi'
# Allow the job to write to the repository
permissions: write-all
# Require the 'create_release' job to complete before running this job
needs: create_release
# Use either macOS 10.15 or macOS 11 for the job
runs-on: ${{ matrix.os }}
env:
# Set the name of the operating system as an environment variable
os-name: ${{ matrix.os }}
# Set the Kivy GL backend to use
KIVY_GL_BACKEND: 'angle_sdl2'
strategy:
# Use a matrix strategy to run the job on multiple operating systems
matrix:
# Specify the macOS versions to use
os: [macos-10.15, macos-11]
steps:
# Checkout the code
- uses: actions/checkout@v2
# Set the VERSION environment variable to the contents of the VERSION file
- run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
# Set up Python 3.9
- uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: 'pip'
# Install Python packages for building the release
- run: pip install -r requirements.txt -r requirements-dev.txt
# Install create-dmg to create a macOS disk image
- run: brew install create-dmg
# Build the macOS release using a Python script
- run: python ./build.py armor.build-osx
# Upload the built release as a release asset
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
# Set the Github token secret to allow uploading the release asset
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Use the upload URL from the 'create_release' job output to upload the asset
upload_url: ${{ needs.create_release.outputs.upload_url }}
# Set the path to the built release file, including the version number and operating system name from the environment variables
asset_path: orb-${{ env.VERSION }}-${{env.os-name}}-x86_64.dmg
# Set the name of the asset to the same as the file name
asset_name: orb-${{ env.VERSION }}-${{env.os-name}}-x86_64.dmg
# Set the content type of the asset as a ZIP file
asset_content_type: application/zip
# Build the Linux release
build_linux:
if: github.ref == 'refs/heads/build_multi'
# Allow the job to write to the repository
permissions: write-all
# Require the 'create_release' job to complete before running this job
needs: create_release
# Use the Ubuntu 20.04 operating system for the job
runs-on: ubuntu-20.04
env:
# Set the name of the operating system as an environment variable
os-name: ubuntu-20.04
steps:
# Checkout the code
- uses: actions/checkout@v2
# Set the VERSION environment variable to the contents of the VERSION file
- run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
# Set up Python 3.8
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: '3.8'
cache: 'pip'
# Install Python packages for building the release
- name: Install requirements
run: |
pip install -r requirements.txt -r requirements-dev.txt
# Build the Linux release using a Python script
- name: Build for Linux
run: python ./build.py armor.build-linux
# Upload the built release as a release asset
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
# Set the Github token secret to allow uploading the release asset
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Use the upload URL from the 'create_release' job output to upload the asset
upload_url: ${{ needs.create_release.outputs.upload_url }}
# Set the path to the built release file, including the version number and operating system name from the environment variables
asset_path: orb-${{ env.VERSION }}-ubuntu-20.04-x86_64.tar.gz
# Set the name of the asset to the same as the file name
asset_name: orb-${{ env.VERSION }}-ubuntu-20.04-x86_64.tar.gz
# Set the content type of the asset as a ZIP file
asset_content_type: application/zip
# Build the Windows release
build_windows:
if: github.ref == 'refs/heads/build_multi'
# Allow the job to write to the repository
permissions: write-all
# Require the 'create_release' job to complete before running this job
needs: create_release
# Use the operating system specified in the matrix as the job's operating system
runs-on: ${{ matrix.os }}
env:
# Set the name of the operating system as an environment variable
os-name: ${{ matrix.os }}
# Set the graphics backend for Kivy
KIVY_GL_BACKEND: 'angle_sdl2'
VERSION: 0.21.16
strategy:
# Define a matrix of operating systems to test on
matrix:
os: [windows-2022, windows-2019]
# Set a 30-minute timeout for the job
timeout-minutes: 30
steps:
# Checkout the code
- uses: actions/checkout@v2
# Set the VERSION environment variable to the contents of the VERSION file
# - run: |
# VER=$(cat VERSION)
# echo "VERSION=$VER" >> $GITHUB_ENV
# Set up Python 3.9
- uses: actions/setup-python@v2
with:
python-version: '3.9'
# Install Python packages for building the release
- run: pip install -r requirements.txt -r requirements-dev.txt
# Build the Windows release using a Python script
- run: python ./build.py armor.build-windows
# Upload the built release as a release asset
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
# Set the Github token secret to allow uploading the release asset
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Use the upload URL from the 'create_release' job output to upload the asset
upload_url: ${{ needs.create_release.outputs.upload_url }}
# Set the path to the built release file, including the version number and operating system name from the environment variables
asset_path: orb-${{ env.VERSION }}-${{env.os-name}}-x86_64.zip
# Set the name of the asset to the same as the file name
asset_name: orb-${{ env.VERSION }}-${{env.os-name}}-x86_64.zip
# Set the content type of the asset as a ZIP file
asset_content_type: application/zip
# Build the Android APK
build_android:
if: github.ref == 'refs/heads/build_multi'
# Allow the job to write to the repository
permissions: write-all
# Require the 'create_release' job to complete before running this job
needs: create_release
# Use the latest version of Ubuntu as the operating system for the job
runs-on: ubuntu-latest
steps:
# Checkout the code
- uses: actions/checkout@v2
# Set the VERSION environment variable to the contents of the VERSION file
- run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
# Set up Python 3.9 and cache pip packages
- uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: 'pip'
# Install Fabric and Semver Python packages
- run: pip install fabric semver
# Use the ArtemSBulgakov/buildozer-action to build the APK using Buildozer
- uses: ArtemSBulgakov/buildozer-action@v1
with:
command: buildozer android debug
buildozer_version: stable
# Upload the built APK as a release asset
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
# Set the Github token secret to allow uploading the release asset
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Use the upload URL from the 'create_release' job output to upload the asset
upload_url: ${{ needs.create_release.outputs.upload_url }}
# Set the path to the built APK file, including the version number from the environment variable
asset_path: bin/orb-${{ env.VERSION }}-armeabi-v7a_arm64-v8a_x86_64-debug.apk
# Set the name of the asset to the same as the file name
asset_name: orb-${{ env.VERSION }}-armeabi-v7a_arm64-v8a_x86_64-debug.apk
# Set the content type of the asset as a ZIP file
asset_content_type: application/zip
# Build documentation
build_docs:
# Run this job only if the repository is 'lightningorb/orb'
if: github.repository == 'lightningorb/orb' && github.ref == 'refs/heads/build_multi'
# Use Ubuntu 20.04 as the operating system for the job
runs-on: ubuntu-20.04
env:
# Set the name of the operating system as an environment variable
os-name: ubuntu-20.04
steps:
# Checkout the code
- uses: actions/checkout@v2
# Set the VERSION environment variable to the contents of the VERSION file
- run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
# Set up Python 3.9 and cache pip packages
- uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: 'pip'
# Install Pandoc to convert markdown to other formats
- run: sudo apt-get install pandoc -y
# Install Python packages for building documentation
- run: pip install -r requirements.txt -r requirements-dev.txt
# Build documentation using a Python script
- run: python ./build.py documentation.build-cli-docs documentation.build
# Upload built documentation to an S3 bucket
- run: aws s3 cp docs/docsbuild/ s3://lnorb/docs/ --recursive --region us-east-2
# Build website
build_site:
# Run this job only if the repository is 'lightningorb/orb'
if: github.repository == 'lightningorb/orb' && (github.ref == 'refs/heads/site' || github.ref == 'refs/heads/build_multi')
# Use Ubuntu 20.04 as the operating system for the job
runs-on: ubuntu-20.04
env:
# Set the name of the operating system as an environment variable
os-name: ubuntu-20.04
steps:
# Checkout the code
- uses: actions/checkout@v2
# Set the VERSION environment variable to the contents of the VERSION file
- run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
# Set up Node.js 16 and its dependencies
- uses: actions/setup-node@v2
with:
node-version: '16'
# Install dependencies and build the website using NPM
- run: cd site && npm install && npm run build
# Upload built website to an S3 bucket
- run: aws s3 cp site/build/ s3://lnorb/ --recursive --region us-east-2