mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 09:33:33 +00:00
116 lines
3.9 KiB
YAML
116 lines
3.9 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 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
|
|
|
|
# Renaming 64-bit APK and moving to safe staging directory
|
|
mv $TEMPUS_PATH/*arm64-v8a*signed.apk ./release-artifacts/app-tempus-arm64-v8a-release.apk
|
|
|
|
# Renaming 32-bit APK and moving to safe staging directory
|
|
mv $TEMPUS_PATH/*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
|
|
|
|
# Renaming 64-bit APK and moving to safe staging directory
|
|
mv $DEGOOGLED_PATH/*arm64-v8a*signed.apk ./release-artifacts/app-degoogled-arm64-v8a-release.apk
|
|
|
|
# Renaming 32-bit APK and moving to safe staging directory
|
|
mv $DEGOOGLED_PATH/*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
|