mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
136 lines
4.5 KiB
YAML
136 lines
4.5 KiB
YAML
name: Github Release Workflow
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[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 APKs
|
|
id: build
|
|
run: |
|
|
# Build release variants
|
|
bash ./gradlew assembleTempusRelease
|
|
bash ./gradlew assembleDegoogledRelease
|
|
# Build debug variants
|
|
bash ./gradlew assembleTempusDebug
|
|
bash ./gradlew assembleDegoogledDebug
|
|
|
|
- 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: |
|
|
# The signing action overwrites the original, so we find the files and rename them.
|
|
TEMPUS_PATH=app/build/outputs/apk/tempus/release
|
|
|
|
# Renaming 64-bit APK
|
|
mv $TEMPUS_PATH/*arm64-v8a*.apk ./app-tempus-arm64-v8a-release.apk
|
|
|
|
# Renaming 32-bit APK
|
|
mv $TEMPUS_PATH/*armeabi-v7a*.apk ./app-tempus-armeabi-v7a-release.apk
|
|
|
|
echo "Prepared Tempus APKs."
|
|
ls -la *.apk
|
|
|
|
# --- DEGOOGLED SIGNING AND RENAMING ---
|
|
- 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: |
|
|
# The signing action overwrites the original, so we find the files and rename them.
|
|
DEGOOGLED_PATH=app/build/outputs/apk/degoogled/release
|
|
|
|
# Renaming 64-bit APK
|
|
mv $DEGOOGLED_PATH/*arm64-v8a*.apk ./app-degoogled-arm64-v8a-release.apk
|
|
|
|
# Renaming 32-bit APK
|
|
mv $DEGOOGLED_PATH/*armeabi-v7a*.apk ./app-degoogled-armeabi-v7a-release.apk
|
|
|
|
echo "Prepared Degoogled APKs."
|
|
ls -la *.apk
|
|
|
|
- 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
|
|
# Attach all four files in one go to the release created above
|
|
files: |
|
|
./app-tempus-arm64-v8a-release.apk
|
|
./app-tempus-armeabi-v7a-release.apk
|
|
./app-degoogled-arm64-v8a-release.apk
|
|
./app-degoogled-armeabi-v7a-release.apk
|
|
|
|
|
|
- name: Upload Debug APKs as artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: debug-apks
|
|
path: |
|
|
app/build/outputs/apk/tempus/debug/
|
|
app/build/outputs/apk/degoogled/debug/
|
|
retention-days: 30
|
|
|
|
- name: Upload Release APKs as artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-apks
|
|
path: |
|
|
./app-tempus-arm64-v8a-release.apk
|
|
./app-tempus-armeabi-v7a-release.apk
|
|
./app-degoogled-arm64-v8a-release.apk
|
|
./app-degoogled-armeabi-v7a-release.apk
|
|
retention-days: 30
|