fix(ci): release workflow

This commit is contained in:
rushiiMachine 2025-06-20 20:20:05 -07:00
parent 245ce1b7f9
commit ea8ab16c18
No known key found for this signature in database
GPG key ID: DCBE5952BB3B6420
3 changed files with 17 additions and 11 deletions

View file

@ -1,4 +1,4 @@
name: Build Debug
name: Build Debug App
on:
push:
@ -12,19 +12,20 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: set up JDK 21
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: zulu
cache: "gradle"
- name: Build project with Gradle
- name: Build with Gradle
run: chmod +x ./gradlew && ./gradlew :app:assembleDebug :app:assembleStaging --stacktrace
- name: Upload apk as artifact
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: app

View file

@ -1,9 +1,8 @@
name: Publish Release
name: Build & Publish Release App
on:
push:
tags: [ "v*.*.*" ]
workflow_dispatch:
concurrency:
group: "release"
@ -26,18 +25,19 @@ jobs:
distribution: zulu
cache: "gradle"
- name: Build Manager
- name: Build with Gradle
env:
SIGNING_KEY_ALIAS: ${{ secrets.keyAlias }}
SIGNING_KEY_PASSWORD: ${{ secrets.keyPassword }}
SIGNING_STORE_PASSWORD: ${{ secrets.keystorePassword }}
SIGNING_STORE_FILE: ${{ github.workspace }}/release.keystore
RELEASE: true
run: |
echo "${{ secrets.keystore }}" | base64 -d > release.keystore
chmod +x ./gradlew && ./gradlew :app:packageRelease --stacktrace
rm release.keystore
- name: Upload apk as artifact
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: app
@ -48,12 +48,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${{ github.ref_name }}"
apk_file="aliucord-manager-$tag.apk"
mv -T ./app/build/outputs/apk/release/app-release.apk "./$apk_file"
gh release create "$tag" \
--title "Aliucord Manager $tag" \
--title "$tag" \
--generate-notes \
--verify-tag \
--fail-on-no-commits \
"../$apk_name"
"./$apk_file"

View file

@ -52,8 +52,12 @@ android {
}
buildTypes {
val isRelease = System.getenv("RELEASE")?.toBoolean() ?: false
val hasReleaseSigning = System.getenv("SIGNING_STORE_PASSWORD")?.isNotEmpty() == true
if (isRelease && !hasReleaseSigning)
error("Missing keystore in a release workflow!")
release {
isMinifyEnabled = true
isShrinkResources = true