forked from eddyizm/tempus
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (105 loc) · 4.74 KB
/
github_release.yml
File metadata and controls
129 lines (105 loc) · 4.74 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Github Release Workflow
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: actions/checkout@v3
- name: Cache Gradle and wrapper
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Setup build tool version variable
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION
- name: Build All Release APKs
id: build
run: |
# Only build release variants (removed debug builds)
bash ./gradlew assembleTempusRelease
bash ./gradlew assembleDegoogledRelease
- name: Create Artifact Staging Directory
run: mkdir -p release-artifacts
- name: Sign Tempus Release APKs
id: sign_tempus_release
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/tempus/release
signingKeyBase64: ${{ secrets.KEYSTORE_BASE64 }}
alias: ${{ secrets.KEY_ALIAS_GITHUB }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD_GITHUB }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Prepare Signed Tempus APKs for Release
run: |
TEMPUS_PATH=app/build/outputs/apk/tempus/release
echo "--- Tempus Files BEFORE Move ---"
ls -la $TEMPUS_PATH
echo "--------------------------------"
# FIX: Use find/xargs for robust file matching and moving.
# Renaming 64-bit APK and moving to safe staging directory
find $TEMPUS_PATH -name '*arm64-v8a*signed.apk' -print0 | xargs -0 mv -t ./release-artifacts/
mv ./release-artifacts/*arm64-v8a*signed.apk ./release-artifacts/app-tempus-arm64-v8a-release.apk
# Renaming 32-bit APK and moving to safe staging directory
find $TEMPUS_PATH -name '*armeabi-v7a*signed.apk' -print0 | xargs -0 mv -t ./release-artifacts/
mv ./release-artifacts/*armeabi-v7a*signed.apk ./release-artifacts/app-tempus-armeabi-v7a-release.apk
echo "Prepared Tempus APKs."
- name: Sign Degoogled Release APKs
id: sign_degoogled_release
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/degoogled/release
signingKeyBase64: ${{ secrets.KEYSTORE_BASE64 }}
alias: ${{ secrets.KEY_ALIAS_GITHUB }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD_GITHUB }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Prepare Signed Degoogled APKs for Release
run: |
DEGOOGLED_PATH=app/build/outputs/apk/degoogled/release
echo "--- Degoogled Files BEFORE Move ---"
ls -la $DEGOOGLED_PATH
echo "--------------------------------"
# FIX: Use find/xargs for robust file matching and moving.
# Renaming 64-bit APK and moving to safe staging directory
find $DEGOOGLED_PATH -name '*arm64-v8a*signed.apk' -print0 | xargs -0 mv -t ./release-artifacts/
mv ./release-artifacts/*arm64-v8a*signed.apk ./release-artifacts/app-degoogled-arm64-v8a-release.apk
# Renaming 32-bit APK and moving to safe staging directory
find $DEGOOGLED_PATH -name '*armeabi-v7a*signed.apk' -print0 | xargs -0 mv -t ./release-artifacts/
mv ./release-artifacts/*armeabi-v7a*signed.apk ./release-artifacts/app-degoogled-armeabi-v7a-release.apk
echo "Prepared Degoogled APKs."
ls -la ./release-artifacts/
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: '> Changelog coming soon'
draft: false
prerelease: false
files: ./release-artifacts/*.apk
- name: Upload Release APKs as artifacts (For easy pipeline access)
uses: actions/upload-artifact@v4
with:
name: release-apks
path: ./release-artifacts/*.apk
retention-days: 30