-
Notifications
You must be signed in to change notification settings - Fork 1
581 lines (507 loc) · 19.7 KB
/
fireback-build.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
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
name: Fireback product(s) test, build and deploy
env:
CI: false
TERM: dumb
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
on:
push:
branches:
- "v**"
- "main"
workflow_dispatch:
inputs:
# target:
# type: choice
# options:
# - ubuntu-x64
# - windows-x64
# - macosx
build_macos:
description: "Build macos"
required: false
default: false
type: boolean
# autodeploy:
# description: "Deploy the binaries after build"
# required: false
# default: true
# type: boolean
jobs:
deploy_github_release:
needs:
- build-windows
- build-ubuntu
- build-macos
- fireback-react-native-android
- vscode-extension
- test-react-code-gen
name: deploy_github_release
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get the version tag
id: get_version_tag
run: echo "tag_name=$(basename ${GITHUB_REF})" >> $GITHUB_ENV
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: true
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ env.tag_name }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/download-artifact@master
with:
name: artifacts-ubuntu
path: artifacts-ubuntu
- uses: actions/download-artifact@master
with:
name: artifacts-vscode
path: artifacts-vscode
- uses: actions/download-artifact@master
with:
name: artifacts-windows
path: artifacts-windows
- uses: actions/download-artifact@master
with:
name: artifacts-darwin
path: artifacts-darwin
- uses: actions/download-artifact@master
with:
name: artifacts-android-react-native
path: artifacts-android-react-native
- name: Upload fireback react native
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-android-react-native/app-release.apk
asset_name: fireback-react-native-android.apk
asset_content_type: application/apk
- name: upload mac amd64 zip artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-darwin/fireback-server-all/fireback_amd64_darwin.zip
asset_name: fireback_amd64_darwin.zip
asset_content_type: application/zip
- name: upload mac arm64 zip artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-darwin/fireback-server-all/fireback_arm64_darwin.zip
asset_name: fireback_arm64_darwin.zip
asset_content_type: application/zip
- name: upload vscode extension
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-vscode/fireback-vscode/fireback-tools.vsix
asset_name: fireback-tools.vsix
asset_content_type: application/vsix
- name: upload mac arm64 pkg artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-darwin/fireback-server-all/fireback_silicon_arm64.pkg
asset_name: fireback_silicon_arm64.pkg
asset_content_type: application/x-newton-compatible-pkg
- name: upload mac amd64 pkg artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-darwin/fireback-server-all/fireback_intel_amd64.pkg
asset_name: fireback_intel_amd64.pkg
asset_content_type: application/x-newton-compatible-pkg
- name: upload windows amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-windows/fireback-server-all/fireback_win_amd64_installer.msi
asset_name: fireback_win_amd64_installer.msi
asset_content_type: application/x-ms-installer
- name: upload windows arm64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-windows/fireback-server-all/fireback_win_arm64_installer.msi
asset_name: fireback_win_arm64_installer.msi
asset_content_type: application/x-ms-installer
- name: upload linux installer arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-ubuntu/fireback-server-all/fireback-arm64.deb
asset_name: fireback-arm64.deb
asset_content_type: application/vnd.debian.binary-package
- name: upload linux installer amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-ubuntu/fireback-server-all/fireback-amd64.deb
asset_name: fireback-amd64.deb
asset_content_type: application/vnd.debian.binary-package
- name: upload linux zip amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-ubuntu/fireback-server-all/fireback_amd64_linux.zip
asset_name: fireback_amd64_linux.zip
asset_content_type: application/zip
- name: upload linux zip arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-ubuntu/fireback-server-all/fireback_arm64_linux.zip
asset_name: fireback_arm64_linux.zip
asset_content_type: application/zip
- name: upload windows zip arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-ubuntu/fireback-server-all/fireback_arm64_windows.zip
asset_name: fireback_arm64_windows.zip
asset_content_type: application/zip
- name: upload windows zip amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts-ubuntu/fireback-server-all/fireback_amd64_windows.zip
asset_name: fireback_amd64_windows.zip
asset_content_type: application/zip
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Download PSCP.exe
run: Invoke-WebRequest https://the.earth.li/~sgtatham/putty/latest/w64/pscp.exe -OutFile pscp.exe
- name: Download wix installer tools
run: Invoke-WebRequest https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip -OutFile wix314-binaries.zip
- name: Create thirdparty directory
run: New-Item -ItemType Directory -Force -Path thirdparty/wix314-binaries
- name: Unzip file
run: Expand-Archive -Path wix314-binaries.zip -DestinationPath thirdparty/wix314-binaries
- name: List contents of thirdparty
run: Get-ChildItem -Path thirdparty
# - name: Download Winrar
# run: Invoke-WebRequest https://www.win-rar.com/fileadmin/winrar-versions/winrar/winrar-x32-621.exe -OutFile winrar-installer.exe
# - name: Install winrar
# run: .\winrar-installer.exe /S
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.1
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install the dependencies
run: cd modules/workspaces/codegen/react-new && npm i --force
- name: Build
run: cd cmd/fireback && make ui2
- name: Package windows
run: cd cmd/fireback && make wininstaller
- uses: actions/upload-artifact@master
with:
name: artifacts-windows
path: artifacts
## Test the module builder ./artifacts/fireback/f gen gof --def modules/workspaces/WorkspaceModule3.yml --relative-to /Users/ali/work/fireback --gof-module github.com/torabian/fireback
## Changes might break them
# - name: Build System Service
# run: cd backend && npm run fb:build:win
# - name: Package the windows
# run: .\cmd\fireback\msi\package-windows.bat
# - name: Package the software
# run: .\backend\cmd\fireback\windows-package.bat
# - name: Upload artifact
# if: ${{ inputs.autodeploy == true }}
# if: ${{ inputs.build_macos == true }}
# run: echo y | .\pscp.exe -pw "${{ secrets.DIGITAL_OCEAN_KEY }}" .\fireback_latest_windows.exe root@pixelplux.com:/var/www/html/fireback-artifacts
build-ubuntu:
# if: ${{ inputs.target == 'ubuntu-x64' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
# - name: Install deps
# run: sudo apt-get update -y && sudo apt install -y sshpass
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install the dependencies
run: cd modules/workspaces/codegen/react-new && npm i --force
- name: Build the UI
run: cd cmd/fireback && make ui2
- name: Build and package deb files
run: cd cmd/fireback && make deb && make linux-zip
- name: Windows zip
run: cd cmd/fireback && make windows-zip
- name: Install debian file for x64
run: sudo dpkg -i artifacts/fireback-server-all/fireback-amd64.deb
- name: Make once more time
run: make
- name: Test if the regenerating fireback definitions is gonna work
run: make test_rebuild
- name: Refresh the direback dependencies
run: make refresh
# - name: Run fireback tests
# run: make test
- uses: actions/upload-artifact@master
with:
name: artifacts-ubuntu
path: artifacts
test-react-code-gen:
needs:
- build-ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/download-artifact@master
with:
name: artifacts-ubuntu
path: artifacts-ubuntu
- name: check artifacts
run: cd artifacts-ubuntu/fireback-server-all && ls -la
- name: install fireback globally
run: sudo dpkg -i artifacts-ubuntu/fireback-server-all/fireback-amd64.deb
- name: generate-sdk
run: fireback gen react --path clients/react-bed/src/sdk
- name: Test the react bed
run: cd clients/react-bed && npm i --force && npm run build
- name: regenerate SDKs
run: make rebuild-sdks-ci
- name: checkout yarn lock because it's unrelated
run: git checkout clients/react-bed/yarn.lock && git checkout modules/workspaces/codegen/react-new/yarn.lock
- name:
Check if the sdk generated is already committed to the codebase.
Fireback changes should not be out of sync with react.js and react native
SDK
run: |
git diff --exit-code
if [[ $(git diff --name-only) ]]; then
echo "Changes detected in the following files:"
git diff --name-only
exit 1
fi
fireback-npm:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
- run: |
cd modules/workspaces/codegen/react-new/src/modules/fireback && npm version --no-git-tag-version 1.1.27-${{ github.sha }} && npm publish --tag=latest --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}
# fireback-react-native-ios:
# runs-on: macos-latest
# steps:
# - name: check Xcode version
# run: /usr/bin/xcodebuild -version
# - name: checkout repository
# uses: actions/checkout@v3
# - name: Debug Workflow Variables
# run: |
# echo "CERTIFICATE_PATH: $CERTIFICATE_PATH"
# echo "PP_PATH: $PP_PATH"
# echo "KEYCHAIN_PATH: $KEYCHAIN_PATH"
# echo "P12_PASSWORD: $P12_PASSWORD"
# - name: Install the Apple certificate and provisioning profile
# env:
# BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
# P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
# PROVISION_PROFILES_BASE64: ${{ secrets.PROVISION_PROFILES_BASE64 }}
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
# run: |
# CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
# PP_ARCHIVE=$RUNNER_TEMP/mobile_pp.tgz
# KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# echo -n "$PROVISION_PROFILES_BASE64" | base64 --decode -o $PP_ARCHIVE
# security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# echo "P12_PASSWORD: $P12_PASSWORD"
# security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
# security list-keychain -d user -s $KEYCHAIN_PATH
# mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
# tar xzvf $PP_ARCHIVE -C $RUNNER_TEMP
# for PROVISION in `ls $RUNNER_TEMP/*.mobileprovision`
# do
# UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i $PROVISION)`
# cp $PROVISION ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision
# done
# security find-identity -v -p codesigning
# ls -l ~/Library/MobileDevice/Provisioning\ Profiles
# - uses: actions/setup-node@v3
# with:
# node-version: '18'
# cache: 'yarn'
# - name: Clean workspace
# run: |
# git clean -ffdx
# npm cache clean --force
# - name: Clean Xcode Build
# run: |
# cd ios
# xcodebuild clean -workspace your_app.xcworkspace -scheme your_app
# - name: install yarn dependencies
# run: |
# cd ios
# yarn install
# - name: install Cocoapod dependencies
# run: |
# cd ios
# pod repo update
# pod install
# - name: build archive
# run: |
# cd ios
# xcodebuild -workspace your_app.xcworkspace \
# -scheme "your_app" \
# -sdk iphoneos \
# -configuration Release \
# -destination generic/platform=iOS \
# -archivePath $RUNNER_TEMP/your_app.xcarchive \
# archive
# - name: export ipa
# env:
# EXPORT_OPTIONS_PLIST: ${{ secrets.EXPORT_OPTIONS_PLIST }}
# run: |
# EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
# echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH
# xcodebuild -exportArchive -archivePath $RUNNER_TEMP/your_app.xcarchive -exportOptionsPlist $EXPORT_OPTS_PATH -exportPath $RUNNER_TEMP/build
# - name: Upload application
# uses: actions/upload-artifact@v3
# with:
# name: app
# path: ${{ runner.temp }}/build
# retention-days: 3
fireback-react-native-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- name: Run Yarn Install
run: |
cd modules/workspaces/codegen/react-native-new && npm i
- name: Build application
run: |
cd modules/workspaces/codegen/react-native-new/android && \
./gradlew assembleRelease
- name: Upload application
uses: actions/upload-artifact@master
with:
name: artifacts-android-react-native
path: modules/workspaces/codegen/react-native-new/android/app/build/outputs/apk/release
vscode-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install react-new dependencies since it contains the designer files
run: cd modules/workspaces/codegen/react-new && npm i --force
- name: Build
run: cd clients/fireback-tools-vs-code-extension && npm i --force && npm run package
- uses: actions/upload-artifact@master
with:
name: artifacts-vscode
path: artifacts
build-macos:
# if: ${{ inputs.build_macos == true }}
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Install sshpass
run: brew install hudochenkov/sshpass/sshpass
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install the dependencies
run: cd modules/workspaces/codegen/react-new && npm i --force
- name: Build Front-end
run: cd cmd/fireback && make ui2
- name: Download Packages installer build tool
run: wget http://s.sudre.free.fr/Software/files/Packages.dmg
- name: Mount Packages image
run: hdiutil attach Packages.dmg
- name: Install Packages
run: sudo installer -pkg /Volumes/Packages\ 1.2.10/Install\ Packages.pkg -target /
- name: Build Backend
run: cd cmd/fireback && make mac-pkg
- uses: actions/upload-artifact@master
with:
name: artifacts-darwin
path: artifacts