-
-
Notifications
You must be signed in to change notification settings - Fork 17
107 lines (89 loc) · 3.34 KB
/
build-apk.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
name: Build APK
on:
push:
tags:
- "v*.*.*"
jobs:
ci:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 21
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install depends
run: bun i
- name: Emit autoimport
run: bun run test src/logic/noop.spec.ts
- name: Typing
run: bun run typing
- name: Test
run: bun run test
build:
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
- uses: actions/setup-node@v4
with:
node-version: 21
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: pnpm/action-setup@v4
with:
version: 8
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Write google-services.json
run: |
echo $'${{ secrets.GOOGLE_SERVICES }}' > src-capacitor/android/app/google-services.json
- name: Write .env
run: |
echo $'SUPABASE_URL="${{ secrets.SUPABASE_URL }}"\nSUPABASE_KEY="${{ secrets.SUPABASE_KEY }}"\nFIREBASE_CONFIG="${{ secrets.FIREBASE_CONFIG }}"' > .env
- name: Install and Build Capacitor 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
bun i
bun run build:android
- name: Rename app-release-unsigned.apk to app-release.apk
run: mv /home/runner/work/app/app/src-capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk /home/runner/work/app/app/src-capacitor/android/app/build/outputs/apk/release/app-release.apk
- uses: filippoLeporati93/android-release-signer@v1
name: Sign app APK
# ID used to access action output
id: sign_app
with:
releaseDirectory: /home/runner/work/app/app/src-capacitor/android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE_CONTENT }}
alias: ${{ secrets.KEYSTORE_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEYSTORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: Setup upterm session
uses: lhotari/action-upterm@v1
if: ${{ failure() }}
with:
## If no one connects after 5 minutes, shut down server.
wait-timeout-minutes: 5
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@c3f61b2a3db543ceee83c759ac8e48419a1a2211
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/[email protected]
with:
files: /home/runner/work/app/app/src-capacitor/android/app/build/outputs/apk/release/app-release-signed.apk
body: ${{ steps.changelog.outputs.changelog }}