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