-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.81 KB
/
build-release.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
# if you want to use this remember to add a signing key, alias, key store password and key password to your github secrets
name: build and release
on:
workflow_dispatch:
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build APK
run: ./gradlew assembleRelease
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
# release on github
- name: Release APK
uses: ncipollo/release-action@v1
with:
artifacts: ${{steps.sign_app.outputs.signedReleaseFile}}
tag: v1.0.${{ github.run_number }}
# rename app to FogApp
- name: Rename APK
run: mv ${{steps.sign_app.outputs.signedReleaseFile}} app/build/outputs/apk/release/FogApp.apk
# copy the app to the server
- name: copy apk to fogoff.fun server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
source: app/build/outputs/apk/release/FogApp.apk
target: /home/fogoff/app
overwrite: true