-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (111 loc) · 3.53 KB
/
Copy pathandroid.yml
File metadata and controls
113 lines (111 loc) · 3.53 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
111
112
113
name: Build & Publish Debug APK
on:
push:
branches:
- master
workflow_dispatch:
jobs:
apk:
name: Generate APK
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Setup venv
run: python -m venv venv
- name: Setup JDK
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 17
- name: Add local.properties
run: touch local.properties
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Make gradlew executable
run: chmod +x gradlew
- name: Add Keystore
env:
LOCAL_PROPERTIES: ${{ secrets.SIGN_KEYSTORE }}
run: echo -n "$LOCAL_PROPERTIES" | base64 -d > ../keystore.jks
- name: Test Keystore
env:
SHA256SUMS: ${{ secrets.SHA256SUMS }}
run: echo $SHA256SUMS | sha256sum -c
- name: Add SigningConfig
env:
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: |
printf "\nreleaseStoreFile=$(realpath $PWD/../keystore.jks)\nRELEASE_STORE_PASSWORD=%s\nRELEASE_KEY_ALIAS=%s\nRELEASE_KEY_PASSWORD=%s\n" \
$RELEASE_STORE_PASSWORD \
$RELEASE_KEY_ALIAS \
$RELEASE_KEY_PASSWORD \
>> gradle.properties
- name: Build APK release
run: ./gradlew assembleRelease --stacktrace
- name: Build APK debug
run: ./gradlew assembleDebug --stacktrace
- name: Upload Debug APK
uses: actions/upload-artifact@v7
with:
name: apkDebug
path: app/build/outputs/apk/debug/BoFiLo*.apk
- name: Upload Release APK
uses: actions/upload-artifact@v7
with:
name: apkRelease
path: app/build/outputs/apk/release/BoFiLo*.apk
release:
name: Release APK
needs: apk
runs-on: ubuntu-latest
steps:
- name: Download APK Debug from build
uses: actions/download-artifact@v8
with:
name: apkDebug
- name: Download APK Release from build
uses: actions/download-artifact@v8
with:
name: apkRelease
- name: Generate release tag
id: tag
run: echo "release_tag=CIBuild_$(date +"%Y.%m.%d_%H-%M")" >> $GITHUB_OUTPUT
- name: Find files
run: find -name "*.apk"
- name: Upload Debug and Release APK
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
name: PreRelease
fail_on_unmatched_files: true
tag_name: ${{ steps.tag.outputs.release_tag }}
files: |
./BoFiLo_*.apk
prerelease: true
generate_release_notes: true
versioning:
name: Increase Version
needs:
- apk
- release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Generate new Version
run: sed -E -i 's/^(VERSION_BUILD=)([0-9]+)$/echo "\1$((\2+1))"/e' app/version.properties
- name: Push
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add app/version.properties
git commit -m "Increase Version [skip ci]"
git push