-
-
Notifications
You must be signed in to change notification settings - Fork 259
110 lines (98 loc) · 3.73 KB
/
nightly.yml
File metadata and controls
110 lines (98 loc) · 3.73 KB
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
name: 🧮 Monthly alpha
on:
workflow_dispatch: # to be able to run it manually
schedule:
- cron: '53 21 27 * *' # on 27 every month
jobs:
evaluateChanges:
name: 🔋 Evaluate changes
runs-on: ubuntu-latest
outputs:
SHOULD_BUILD: ${{ steps.check.outputs.shouldBuild }}
steps:
- name: 🌡️ Check
id: check
run: |
echo shouldBuild=true >> $GITHUB_OUTPUT
build:
name: 📆 Monthlies
runs-on: ubuntu-latest
needs: evaluateChanges
if: needs.evaluateChanges.outputs.SHOULD_BUILD == 'true'
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
ALPHA_BUILD_VARIANT: "assembleWebsiteFullAlpha"
# glob: github.com/actions/toolkit/tree/b48854e/packages/glob
ALPHA_BUILD_OUT: "./app/build/outputs/apk/**/*.apk"
steps:
- name: 🥏 Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: ☕️ JDKv17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: 🎪 Secrets
if: success()
# TODO: change build variant to fdroid if json does not exist
# developers.google.com/android/guides/google-services-plugin#adding_the_json_file
run: |
mkdir -p app/src/alpha
echo "${GSCV_TEST_JSON}" > app/src/alpha/google-services.json
# expected: l:29 w:45 m:691
wc -lwm app/src/alpha/google-services.json
env:
GSCV_TEST_JSON: ${{ secrets.GOOGLE_SERVICES_TEST_JSON }}
- name: 🫙 Alpha keystore
run: |
echo "${{ secrets.ALPHA_KS_ASC }}" > alphaKeystore.jks.asc
gpg -d --passphrase "${{ secrets.ALPHA_KS_PASSPHRASE }}" --batch alphaKeystore.jks.asc > app/rdnsAlpha.jks
wc -wcl alphaKeystore.jks.asc app/rdnsAlpha.jks
- name: 🏗️ Build & notify
run: |
./gradlew ${ALPHA_BUILD_VARIANT} --info --warning-mode all
env:
ALPHA_KS_ALIAS: ${{ vars.ALPHA_KS_ALIAS }}
ALPHA_KS_FILE: ${{ vars.ALPHA_KS_FILE }}
ALPHA_KS_STORE_PASSPHRASE: ${{ secrets.ALPHA_KS_STORE_PASSPHRASE }}
ALPHA_KS_PASSPHRASE: ${{ secrets.ALPHA_KS_PASSPHRASE }}
VERSION_CODE: ${{ github.run_number }}
# version-code: archive.is/y8uCB
- name: 🍫 APKs
run: |
# ./app/build/outputs/apk/websiteFull/alpha/app-website-full-armeabi-v7a-alpha.apk
find "$PWD" -type f -iname '*.apk'
# github.com/actions/upload-artifact
- name: 📜 Upload artifact
uses: actions/upload-artifact@v6
id: a3
with:
name: rdns-alpha-${{ github.sha }}
path: ${{ env.ALPHA_BUILD_OUT }}
if-no-files-found: error
retention-days: 72
compression-level: 9
- name: 💬 Telegram
continue-on-error: true
if: env.TELEGRAM_CHAT_ID && env.TELEGRAM_TOKEN
run: |
set +e
# core.telegram.org/bots/api#sendmessage
curl -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
-d "chat_id=${TELEGRAM_CHAT_ID}" \
-d "parse_mode=HTML" \
--data-urlencode "text=<a href='${DOC}'>${NOM}</a>"
# core.telegram.org/bots/api#senddocument
# size limit 50mb
# curl https://api.telegram.org/bot$TELEGRAM_TOKEN/sendDocument \
# -F chat_id="$TELEGRAM_CHAT_ID" \
# -F caption="sha256: ${CAP}" \
# -F parse_mode=HTML \
# -F document=@"$DOC"
env:
NOM: "rdns-alpha-${{ github.sha }}"
DOC: ${{ steps.a3.outputs.artifact-url }}
CAP: ${{ steps.a3.outputs.artifact-id }}