forked from FreeTubeApp/FreeTube
-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (81 loc) · 2.97 KB
/
buildCordova.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build Cordova
on:
push:
branches: [ development ]
jobs:
build:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: 🧶 Yarn install
run: yarn ci
- name: 🔍Lint code
run: yarn lint
- name: 📚Read package.json
id: pkg
uses: jaywcjlove/github-action-package@v1.3.0
- name: Set Version Number Variable
id: versionNumber
uses: actions/github-script@v6
with:
result-encoding: string
script: |
return '${{ steps.pkg.outputs.version }}-nightly-${{ github.run_number }}'
- name: Set App ID Variable
id: appId
uses: actions/github-script@v6
with:
result-encoding: string
script: |
return '${{ steps.pkg.outputs.name }}.nightly'
- name: ⬆ Update package.json version
uses: jossef/action-set-json-field@v2.1
with:
file: package.json
field: version
value: ${{ steps.versionNumber.outputs.result }}
- name: ⬆ Update package.json app environment
uses: jossef/action-set-json-field@v2.1
with:
file: package.json
field: name
value: ${{ steps.appId.outputs.result }}
- name: ⬆ Update package.json product name
uses: jossef/action-set-json-field@v2.1
with:
file: package.json
field: productName
value: ${{ steps.pkg.outputs.productName }} Nightly
- name: 📦 Pack for 🕸web with Node.js
run: yarn pack:web
- name: 📡 Upload PWA Artifact
uses: actions/upload-artifact@v3
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-PWA
path: dist/web
- name: 🚧 Setup Android SDK Tools
uses: android-actions/setup-android@v2.0.9
- name: 📦 Pack for 📱Android with Node.js & Cordova
run: yarn pack:cordova
- name: 🦴 Fetch keystore from secrets
run: |
while read -r line;
do
echo "${line}" >> freetube.keystore.asc
done <<< '${{ secrets.KEYSTORE }}'
gpg -d --passphrase '${{ secrets.KEYSTORE_PASSWORD }}' --batch freetube.keystore.asc >> freetube.keystore
- name: 👷♀️ Build APK with Cordova with Node.js
run: yarn build:cordova freetube-${{ steps.versionNumber.outputs.result }}.apk ./freetube.keystore ${{ secrets.KEYSTORE_PASSWORD }}
- name: 📡 Upload Cordova APK Artifact
uses: actions/upload-artifact@v3
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-Android.apk
path: dist/freetube-${{ steps.versionNumber.outputs.result }}.apk