-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 2.49 KB
/
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
name: Build Streamely App
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Cache Gradle files
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Cordova
run: npm install -g cordova
- name: Add Android platform
run: cordova platform add android
- name: Install app dependencies
run: npm install
- name: Decrypt Keystore
run: |
echo "${{ secrets.STREAMELY_RELEASE_KEY }}" > streamely.release-key.asc
gpg -d --passphrase "${{ secrets.STREAMELY_RELEASE_PASSPHRASE }}" --batch streamely.release-key.asc > streamely-release-key.jks
- name: Build release APK using Cordova
run: cordova build android --release -- --packageType=apk --keystore=streamely-release-key.jks --storePassword=${{ secrets.KEYSTORE_PASSWORD }} --alias=${{ secrets.KEY_ALIAS }} --password=${{ secrets.KEY_PASSWORD }}
- name: release-please
uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
- name: Upload Release Artifact
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.MY_PAT }}
run: gh release upload ${{ steps.release.outputs.tag_name }} ./platforms/android/app/build/outputs/apk/release/app-release.apk