Refactor PR build check workflow for improved readability and structure [skip ci]
This commit is contained in:
46
.github/workflows/pr-build-check.yml
vendored
46
.github/workflows/pr-build-check.yml
vendored
@@ -1,27 +1,22 @@
|
||||
name: PR Build Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'android/**'
|
||||
- '.github/workflows/pr-build-check.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build & Test APK
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Code auschecken
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Java einrichten
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Gradle Cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
@@ -31,7 +26,6 @@ jobs:
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Version auslesen
|
||||
run: |
|
||||
VERSION_NAME=$(grep "versionName = " android/app/build.gradle.kts | sed 's/.*versionName = "\(.*\)".*/\1/')
|
||||
@@ -39,18 +33,15 @@ jobs:
|
||||
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
|
||||
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
|
||||
echo "📱 Version: $VERSION_NAME (Code: $VERSION_CODE)"
|
||||
|
||||
- name: Debug Build erstellen (ohne Signing)
|
||||
run: |
|
||||
cd android
|
||||
./gradlew assembleStandardDebug assembleFdroidDebug --no-daemon --stacktrace
|
||||
|
||||
- name: Unit Tests ausfuehren
|
||||
run: |
|
||||
cd android
|
||||
./gradlew test --no-daemon --stacktrace
|
||||
continue-on-error: true
|
||||
|
||||
- name: Build-Ergebnis pruefen
|
||||
run: |
|
||||
if [ -f "android/app/build/outputs/apk/standard/debug/app-standard-universal-debug.apk" ]; then
|
||||
@@ -60,7 +51,6 @@ jobs:
|
||||
echo "❌ Standard Debug APK Build fehlgeschlagen"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "android/app/build/outputs/apk/fdroid/debug/app-fdroid-universal-debug.apk" ]; then
|
||||
echo "✅ F-Droid Debug APK erfolgreich gebaut"
|
||||
ls -lh android/app/build/outputs/apk/fdroid/debug/*.apk
|
||||
@@ -68,7 +58,6 @@ jobs:
|
||||
echo "❌ F-Droid Debug APK Build fehlgeschlagen"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Debug APKs hochladen (Artefakte)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -77,7 +66,6 @@ jobs:
|
||||
android/app/build/outputs/apk/standard/debug/*.apk
|
||||
android/app/build/outputs/apk/fdroid/debug/*.apk
|
||||
retention-days: 30
|
||||
|
||||
- name: Kommentar zu PR hinzufuegen
|
||||
uses: actions/github-script@v7
|
||||
if: success()
|
||||
@@ -88,26 +76,24 @@ jobs:
|
||||
.filter(f => f.endsWith('.apk'));
|
||||
const fdroidApk = fs.readdirSync('android/app/build/outputs/apk/fdroid/debug/')
|
||||
.filter(f => f.endsWith('.apk'));
|
||||
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `## ✅ Build erfolgreich!
|
||||
|
||||
**Version:** ${{ env.VERSION_NAME }} (Code: ${{ env.VERSION_CODE }})
|
||||
|
||||
### 📦 Debug APKs (Test-Builds)
|
||||
|
||||
Die Debug-APKs wurden erfolgreich gebaut und sind als Artefakte verfuegbar:
|
||||
|
||||
**Standard Flavor:**
|
||||
${standardApk.map(f => '- `' + f + '`').join('\n')}
|
||||
|
||||
**F-Droid Flavor:**
|
||||
${fdroidApk.map(f => '- `' + f + '`').join('\n')}
|
||||
|
||||
> ⚠️ **Hinweis:** Dies sind unsigned Debug-Builds zum Testen. Production Releases werden nur bei Merge auf \`main\` erstellt.
|
||||
|
||||
[📥 Download Artefakte](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`
|
||||
})
|
||||
|
||||
**Version:** ${{ env.VERSION_NAME }} (Code: ${{ env.VERSION_CODE }})
|
||||
|
||||
### 📦 Debug APKs (Test-Builds)
|
||||
Die Debug-APKs wurden erfolgreich gebaut und sind als Artefakte verfuegbar:
|
||||
|
||||
**Standard Flavor:**
|
||||
${standardApk.map(f => '- \`' + f + '\`').join('\n')}
|
||||
|
||||
**F-Droid Flavor:**
|
||||
${fdroidApk.map(f => '- \`' + f + '\`').join('\n')}
|
||||
|
||||
> ⚠️ **Hinweis:** Dies sind unsigned Debug-Builds zum Testen. Production Releases werden nur bei Merge auf \`main\` erstellt.
|
||||
|
||||
[📥 Download Artefakte](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`
|
||||
})
|
||||
Reference in New Issue
Block a user