This commit is contained in:
nomadics9 2024-12-16 03:18:55 +03:00
parent 9d4886fb14
commit 605b1724d4

View file

@ -1,5 +1,4 @@
name: Build and Customize Android App from Release
name: Build Latest
on:
workflow_dispatch: # Allows manual triggering of the workflow
@ -8,24 +7,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
# Step 1: Download the latest release tarball
- name: Download Latest Release
run: |
curl -s https://api.github.com/repos/jellyfin/jellyfin-androidtv/releases/latest \
| jq -r '.tarball_url' \
| xargs curl -L -o latest-release.tar.gz
# Step 2: Extract the tarball
- name: Extract Release Tarball
run: |
mkdir -p app-release
tar -xzf latest-release.tar.gz --strip-components=1 -C app-release
# Step 3: Parse version.txt
- name: Parse version.txt
id: parse_version
run: |
@ -39,13 +34,11 @@ jobs:
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
# Step 4: Replace assets in app/src/main/
- name: Replace Assets
run: |
rm -r app-release/app/src/main/res/mipmap-*
cp -r res/* app-release/app/src/main/res
# Step 5: Changes
- name: Update strings.xml
run: |
sed -i 's/Jellyfin/AlaskarTV/g' app-release/app/src/main/res/values/strings.xml
@ -82,18 +75,15 @@ jobs:
sed -i 's/jellyfin-androidtv/alaskartv-androidtv/' \
app-release/app/src/main/java/org/jellyfin/androidtv/ui/startup/fragment/SelectServerFragment.kt
- name: Check files
- name: Push Source Code
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
echo "Updated Changes"
cat app-release/app/build.gradle.kts
cat app-release/app/src/main/res/values/strings.xml
cat app-release/app/src/main/java/org/jellyfin/androidtv/preference/UserPreferences.kt
cat app-release/app/src/main/java/org/jellyfin/androidtv/ui/preference/category/about.kt
cat app-release/app/src/main/java/org/jellyfin/androidtv/ui/startup/fragment/SelectServerFragment.kt
git remote add new-origin https://github.com/nomadics9/alaskartv.git
git add .
git commit -m "Update"
git push new-origin main
# Step 6: Set up Java and Gradle
- name: Set up Java
uses: actions/setup-java@v4
with:
@ -108,18 +98,19 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-21release-
# Step 7: Build the APK
- name: Build APK
run: |
cd app-release
./gradlew assembleRelease
- name: Find APK Files
run: find app-release -name "*.apk"
- name: Build AAB
run: |
cd app-release
./gradlew bundleRelease
- name: Sign app APK
- name: Sign APK
uses: ilharp/sign-android-release@v1 # Or use @nightly
id: sign_app
id: sign_apk
with:
releaseDir: app-release/app/build/outputs/apk/release
signingKey: ${{ secrets.KEYSTORE_FILE }}
@ -127,13 +118,27 @@ jobs:
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
buildToolsVersion: 35.0.0
# Step 11: Upload Signed APK as Artifact
- name: Sign AAB
uses: ilharp/sign-android-release@v1 # Or use @nightly
id: sign_aab
with:
releaseDir: app-release/app/build/outputs/bundle/release
signingKey: ${{ secrets.KEYSTORE_FILE }}
keyAlias: ${{ secrets.KEYSTORE_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
buildToolsVersion: 35.0.0
- name: Upload Signed APK
uses: actions/upload-artifact@v4
with:
name: signed-apk
path: ${{ steps.sign_app.outputs.signedFiles }}
# path: app-release/app/build/outputs/apk/release/alaskartv-androidtv-v${{ env.VERSION_NAME }}-release-signed.apk
path: ${{ steps.sign_apk.outputs.signedFiles }}
- name: Upload Signed AAB
uses: actions/upload-artifact@v4
with:
name: signed-aab
path: ${{ steps.sign_aab.outputs.signedFiles }}