-
Notifications
You must be signed in to change notification settings - Fork 400
81 lines (70 loc) · 2.57 KB
/
build-app.yaml
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
name: App
on:
pull_request:
push:
env:
# Our build metadata
BUILD_USER: builder
BUILD_HOST: github.syncthing.net
jobs:
build:
name: Debug Build
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
container: ghcr.io/syncthing/syncthing-android-builder
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: build
run: |
java -version
./gradlew --no-daemon buildNative lint assembleDebug
- uses: actions/upload-artifact@v3
with:
name: syncthing-android-debug.apk
path: app/build/outputs/apk/debug/app-debug.apk
- uses: actions/upload-artifact@v3
with:
name: reports-and-libs
path: |
app/build/reports/**
app/src/main/jniLibs/**
release:
name: Release Build and Publish
if: github.event_name == 'push' && false
runs-on: ubuntu-latest
container: ghcr.io/syncthing/syncthing-android-builder
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: build
env:
SYNCTHING_RELEASE_KEY_ALIAS: android
SIGNING_PASSWORD: '${{ secrets.SIGNING_PASSWORD }}'
SYNCTHING_RELEASE_STORE_FILE: '${{ RUNNER_TEMP }}/signing-keystore.jks'
SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE: '${{ RUNNER_TEMP }}/google-play-secrets.json'
shell: bash # main purpose: enables -eo pipefail
run: |
echo "$SIGNING_KEYSTORE_JKS_BASE64" | base64 -d > "$SYNCTHING_RELEASE_STORE_FILE"
echo "$GOOGLE_PLAY_SECRETS_BASE64" | base64 -d > "$SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE"
java -version
./gradlew --no-daemon buildNative lint assembleRelease publishReleaseApps
rm "$SYNCTHING_RELEASE_STORE_FILE" "$SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE"
echo "$GNUPG_SIGNING_KEY_BASE64" | base64 -d | gpg --import
cd app/build/outputs/apk/release
sha256sum app-release.apk | gpg --clearsign > sha256sum.txt.asc
- uses: actions/upload-artifact@v3
with:
name: release
path: |
app/build/outputs/apk/release/*.apk
app/build/outputs/apk/release/*.asc
- uses: ncipollo/release-action@v1
with:
artifacts: "app/build/outputs/apk/release/*.apk,app/build/outputs/apk/release/*.asc"
artifactErrorsFailBuild: true
bodyFile: "app/src/main/play/release-notes/en-GB/default.txt"
prerelease: ${{ contains('-rc.', github.ref_name) }}
draft: true