-
Notifications
You must be signed in to change notification settings - Fork 101
126 lines (104 loc) · 3.63 KB
/
testnet-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
# Build a Phoenix apk for Testnet, using the master branch.
name: Build
on:
workflow_dispatch:
push:
branches: [ master, test-ci-build ]
paths:
- 'phoenix-legacy/**'
- 'phoenix-android/**'
- '.github/workflows/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1 - checkout project and dependencies
- name: Checkout Phoenix
uses: actions/checkout@v2
with:
path: phoenix
- name: Checkout lightning-kmp
uses: actions/checkout@v2
with:
repository: ACINQ/lightning-kmp
ref: master
path: lightning-kmp
- name: Checkout eclair-core
uses: actions/checkout@v2
with:
repository: ACINQ/eclair
ref: android-phoenix
path: eclair-core
- name: Checkout Tor_Onion_Proxy_Library (Tor for legacy android app)
uses: actions/checkout@v2
with:
repository: ACINQ/Tor_Onion_Proxy_Library
path: tor-lib
# 2 - setup cache/jdk
- name: Cache maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cached Konan
uses: actions/cache@v2
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-konan-
- name: Set up jdk 1.17
uses: actions/setup-java@v1
with:
java-version: 17
# 3 - build dependencies & app
- name: Build lightning-kmp and install to local maven repo
run: |
cd lightning-kmp
./gradlew clean build publishToMavenLocal -x check
- name: Build eclair-core and install to local maven repo
run: |
cd eclair-core
mvn clean install -pl eclair-core -am -Dmaven.test.skip=true
- name: Build Tor_Onion_Proxy_Library and install to local maven repo
run: |
cd tor-lib
./gradlew :universal:build
./gradlew :universal:publishToMavenLocal
./gradlew :android:build
./gradlew :android:publishToMavenLocal
- name: Assemble new android app apk
run: |
cd phoenix
./gradlew clean
printf "\nskip.android=false" >> local.properties
./gradlew :phoenix-android:assembleRelease --stacktrace
# 4 - sign apk
- name: Retrieve signing key
run: 'echo "$TESTNET_KEY_HEX" | xxd -r -p > signingkey'
shell: bash
env:
TESTNET_KEY_HEX: ${{secrets.TESTNET_KEY_HEX}}
- name: Sign artifact
run: |
mkdir upload
mv phoenix/phoenix-android/build/outputs/apk/release/phoenix-*.apk upload/phoenix-testnet-latest.apk
/usr/local/lib/android/sdk/build-tools/30.0.3/apksigner sign --ks signingkey --ks-pass pass:$TESTNET_STORE_PASS --ks-key-alias $TESTNET_ALIAS --key-pass pass:$TESTNET_KEY_PASS upload/phoenix-testnet-latest.apk
shell: bash
env:
TESTNET_STORE_PASS: ${{secrets.TESTNET_STORE_PASS}}
TESTNET_ALIAS: ${{secrets.TESTNET_ALIAS}}
TESTNET_KEY_PASS: ${{secrets.TESTNET_KEY_PASS}}
# 5 - upload apk
- name: Upload apk as artifact for this action
uses: actions/upload-artifact@v2
with:
name: phoenix-testnet
path: upload/phoenix-testnet-latest.apk
- name: Upload to acinq.co
run: |
aws s3 cp ./upload/phoenix-testnet-latest.apk s3://acinq.co/pub/phoenix/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'eu-west-1'