2024-12-16 00:18:55 +00:00
|
|
|
name: Build Latest
|
2024-12-15 02:31:56 +00:00
|
|
|
on:
|
2024-12-16 12:50:14 +00:00
|
|
|
workflow_dispatch:
|
2024-12-16 01:10:43 +00:00
|
|
|
push:
|
|
|
|
paths:
|
2024-12-19 03:15:19 +00:00
|
|
|
- release.txt
|
|
|
|
- version.txt
|
2024-12-15 02:31:56 +00:00
|
|
|
|
|
|
|
jobs:
|
2024-12-16 00:54:21 +00:00
|
|
|
AlaskarTV:
|
2025-01-04 03:59:08 +00:00
|
|
|
runs-on: docker
|
2025-01-04 20:30:02 +00:00
|
|
|
container: ghcr.io/catthehacker/ubuntu:act-latest
|
2024-12-15 02:31:56 +00:00
|
|
|
|
|
|
|
steps:
|
2024-12-15 03:01:19 +00:00
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-12-15 02:31:56 +00:00
|
|
|
- name: Download Latest Release
|
|
|
|
run: |
|
2024-12-15 02:35:57 +00:00
|
|
|
curl -s https://api.github.com/repos/jellyfin/jellyfin-androidtv/releases/latest \
|
2024-12-15 02:31:56 +00:00
|
|
|
| jq -r '.tarball_url' \
|
|
|
|
| xargs curl -L -o latest-release.tar.gz
|
|
|
|
|
|
|
|
- name: Extract Release Tarball
|
|
|
|
run: |
|
|
|
|
mkdir -p app-release
|
|
|
|
tar -xzf latest-release.tar.gz --strip-components=1 -C app-release
|
|
|
|
|
|
|
|
- name: Parse version.txt
|
|
|
|
id: parse_version
|
|
|
|
run: |
|
|
|
|
# Read values from version.txt
|
|
|
|
APPLICATION_ID=$(grep '^APPLICATION_ID=' version.txt | cut -d '=' -f 2)
|
|
|
|
VERSION_NAME=$(grep '^VERSION_NAME=' version.txt | cut -d '=' -f 2)
|
|
|
|
VERSION_CODE=$(grep '^VERSION_CODE=' version.txt | cut -d '=' -f 2)
|
|
|
|
|
|
|
|
# Export values as environment variables
|
|
|
|
echo "APPLICATION_ID=$APPLICATION_ID" >> $GITHUB_ENV
|
|
|
|
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
|
|
|
|
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Replace Assets
|
|
|
|
run: |
|
2024-12-15 04:41:11 +00:00
|
|
|
rm -r app-release/app/src/main/res/mipmap-*
|
2024-12-15 02:57:45 +00:00
|
|
|
cp -r res/* app-release/app/src/main/res
|
2024-12-15 02:31:56 +00:00
|
|
|
|
2024-12-16 14:22:01 +00:00
|
|
|
- name: Update AndroidManifest.xml banner
|
|
|
|
run: |
|
|
|
|
sed -i 's/android:banner="@mipmap\/app_banner"/android:banner="@drawable\/app_banner"/' app-release/app/src/main/AndroidManifest.xml
|
|
|
|
|
2024-12-15 02:31:56 +00:00
|
|
|
- name: Update strings.xml
|
|
|
|
run: |
|
2024-12-15 02:57:45 +00:00
|
|
|
sed -i 's/Jellyfin/AlaskarTV/g' app-release/app/src/main/res/values/strings.xml
|
2024-12-15 02:31:56 +00:00
|
|
|
|
|
|
|
- name: Update build.gradle.kts
|
|
|
|
env:
|
|
|
|
APPLICATION_ID: ${{ env.APPLICATION_ID }}
|
|
|
|
VERSION_NAME: ${{ env.VERSION_NAME }}
|
|
|
|
VERSION_CODE: ${{ env.VERSION_CODE }}
|
|
|
|
run: |
|
2024-12-15 15:45:40 +00:00
|
|
|
sed -i 's/applicationId = namespace/applicationId = "'"$APPLICATION_ID"'"/' app-release/app/build.gradle.kts
|
|
|
|
sed -i 's/versionName = .*/versionName = "'"$VERSION_NAME"'"/' app-release/app/build.gradle.kts
|
2024-12-15 02:57:45 +00:00
|
|
|
sed -i "s/versionCode = .*/versionCode = $VERSION_CODE/" app-release/app/build.gradle.kts
|
2024-12-15 15:16:29 +00:00
|
|
|
sed -i "s/setProperty(\"archivesBaseName\", \".*\")/setProperty(\"archivesBaseName\", \"alaskartv-androidtv-v$VERSION_NAME\")/" app-release/app/build.gradle.kts
|
2024-12-15 02:31:56 +00:00
|
|
|
|
|
|
|
- name: Update about.kt
|
|
|
|
run: |
|
2024-12-15 22:08:30 +00:00
|
|
|
sed -i '
|
|
|
|
s/title = "Jellyfin app version"/title = "AlaskarTV app version"/
|
|
|
|
s/content = "jellyfin-androidtv .*/content = "alaskartv-androidtv ${BuildConfig.VERSION_NAME} ${BuildConfig.BUILD_TYPE}"/
|
|
|
|
s/icon = R.drawable.ic_jellyfin/icon = R.drawable.app_icon_foreground_monochrome/
|
|
|
|
' app-release/app/src/main/java/org/jellyfin/androidtv/ui/preference/category/about.kt
|
2024-12-15 03:54:32 +00:00
|
|
|
|
2024-12-15 15:16:29 +00:00
|
|
|
- name: Update UserPreferences.kt
|
|
|
|
run: |
|
|
|
|
sed -i 's/booleanPreference("trick_play_enabled", false)/booleanPreference("trick_play_enabled", true)/' \
|
|
|
|
app-release/app/src/main/java/org/jellyfin/androidtv/preference/UserPreferences.kt
|
2024-12-15 03:54:32 +00:00
|
|
|
|
2024-12-15 15:16:29 +00:00
|
|
|
sed -i 's/enumPreference("app_theme", AppTheme.DARK)/enumPreference("app_theme", AppTheme.MUTED_PURPLE)/' \
|
|
|
|
app-release/app/src/main/java/org/jellyfin/androidtv/preference/UserPreferences.kt
|
2024-12-15 03:54:32 +00:00
|
|
|
|
2024-12-15 23:35:46 +00:00
|
|
|
- name: Update SelectServerFragment.kt
|
|
|
|
run: |
|
|
|
|
sed -i 's/jellyfin-androidtv/alaskartv-androidtv/' \
|
|
|
|
app-release/app/src/main/java/org/jellyfin/androidtv/ui/startup/fragment/SelectServerFragment.kt
|
|
|
|
|
2025-01-04 03:59:08 +00:00
|
|
|
# - name: Push Source Code
|
|
|
|
# env:
|
|
|
|
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
|
|
# run: |
|
|
|
|
# cd app-release
|
|
|
|
# rm -rf .git .github CODEOWNERS CONTRIBUTORS.md README.md
|
|
|
|
# git init
|
|
|
|
# git config --global user.email "binaskar@gmail.com"
|
|
|
|
# git config --global user.name "nomadics9"
|
|
|
|
# git remote add origin https://x-access-token:${GITHUB_TOKEN}@github.com/nomadics9/alaskartv.git
|
|
|
|
# git add .
|
|
|
|
# git commit -m "Update"
|
|
|
|
# git branch -M main
|
|
|
|
# git push origin main --force
|
2024-12-15 02:31:56 +00:00
|
|
|
|
|
|
|
- name: Set up Java
|
2025-01-04 04:04:48 +00:00
|
|
|
uses: https://github.com/actions/setup-java@v4
|
2024-12-15 02:31:56 +00:00
|
|
|
with:
|
2024-12-15 14:17:17 +00:00
|
|
|
distribution: temurin
|
2024-12-15 14:46:10 +00:00
|
|
|
java-version: 21
|
2024-12-15 04:26:12 +00:00
|
|
|
|
|
|
|
- name: Cache Gradle dependencies
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
2024-12-15 21:03:44 +00:00
|
|
|
key: ${{ runner.os }}-gradle-21release-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
2024-12-15 04:26:12 +00:00
|
|
|
restore-keys: |
|
2024-12-15 21:03:44 +00:00
|
|
|
${{ runner.os }}-gradle-21release-
|
2024-12-15 02:31:56 +00:00
|
|
|
|
|
|
|
- name: Build APK
|
|
|
|
run: |
|
|
|
|
cd app-release
|
2024-12-15 21:03:44 +00:00
|
|
|
./gradlew assembleRelease
|
2024-12-15 02:31:56 +00:00
|
|
|
|
2024-12-16 00:18:55 +00:00
|
|
|
- name: Build AAB
|
|
|
|
run: |
|
|
|
|
cd app-release
|
|
|
|
./gradlew bundleRelease
|
2024-12-15 02:31:56 +00:00
|
|
|
|
2024-12-16 00:18:55 +00:00
|
|
|
- name: Sign APK
|
2025-01-04 04:08:53 +00:00
|
|
|
uses: https://github.com/ilharp/sign-android-release@v1
|
2024-12-16 00:18:55 +00:00
|
|
|
id: sign_apk
|
2024-12-15 22:39:04 +00:00
|
|
|
with:
|
2024-12-15 23:35:46 +00:00
|
|
|
releaseDir: app-release/app/build/outputs/apk/release
|
2024-12-15 23:24:31 +00:00
|
|
|
signingKey: ${{ secrets.KEYSTORE_FILE }}
|
|
|
|
keyAlias: ${{ secrets.KEYSTORE_ALIAS }}
|
2024-12-15 22:39:04 +00:00
|
|
|
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
|
2024-12-15 23:24:31 +00:00
|
|
|
buildToolsVersion: 35.0.0
|
2024-12-15 05:01:07 +00:00
|
|
|
|
2024-12-16 00:18:55 +00:00
|
|
|
- name: Sign AAB
|
2025-01-04 04:08:00 +00:00
|
|
|
uses: https://github.com/ilharp/sign-android-release@v1
|
2024-12-16 00:18:55 +00:00
|
|
|
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
|
|
|
|
|
2024-12-15 21:03:44 +00:00
|
|
|
- name: Upload Signed APK
|
2025-01-04 12:58:03 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2024-12-15 02:31:56 +00:00
|
|
|
with:
|
2024-12-15 21:03:44 +00:00
|
|
|
name: signed-apk
|
2024-12-16 00:18:55 +00:00
|
|
|
path: ${{ steps.sign_apk.outputs.signedFiles }}
|
|
|
|
|
|
|
|
- name: Upload Signed AAB
|
2025-01-04 12:58:03 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2024-12-16 00:18:55 +00:00
|
|
|
with:
|
|
|
|
name: signed-aab
|
|
|
|
path: ${{ steps.sign_aab.outputs.signedFiles }}
|
2024-12-15 21:03:44 +00:00
|
|
|
|
2024-12-16 01:45:10 +00:00
|
|
|
- name: Upload Debug Symbols
|
2025-01-04 12:58:03 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2024-12-16 01:45:10 +00:00
|
|
|
with:
|
|
|
|
name: debug-symbols
|
2024-12-16 04:06:24 +00:00
|
|
|
path: app-release/app/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
|
2024-12-16 01:56:06 +00:00
|
|
|
|
2025-01-04 20:28:00 +00:00
|
|
|
publish:
|
|
|
|
runs-on: docker
|
|
|
|
needs: build
|
|
|
|
if: github.event_name == 'workflow_dispatch'
|
|
|
|
container: ghcr.io/catthehacker/ubuntu:act-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Get latest successful run ID
|
|
|
|
id: get-run
|
|
|
|
run: |
|
|
|
|
LATEST_RUN=$(curl -s -H "Authorization: token ${FORGEJO_TOKEN}" \
|
|
|
|
"https://git.askar.tv/api/v1/repos/nomad/alaskartv-app/actions/runs?status=success&event=push&branch=main" | \
|
|
|
|
jq -r '.[] | select(.workflow_id=="main.yml") | .id' | head -n1)
|
|
|
|
echo "run_id=$LATEST_RUN" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
- name: Test API
|
|
|
|
env:
|
|
|
|
MY_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
|
|
run: |
|
|
|
|
curl -v -H "Authorization: token $MY_TOKEN" \
|
|
|
|
"https://git.askar.tv/api/v1/repos/${{ github.repository }}/actions/runs"
|
|
|
|
|
|
|
|
- name: Download Signed AAB
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: signed-aab
|
|
|
|
path: ./release
|
|
|
|
|
|
|
|
|
|
|
|
- name: Download Debug Symbols
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: debug-symbols
|
|
|
|
path: ./release/symbols
|
|
|
|
|
|
|
|
- name: Use What's New Message
|
|
|
|
run: |
|
|
|
|
mkdir ./release/whatsnew
|
|
|
|
cp whatsnew.txt ./release/whatsnew/whatsnew-en-US
|
|
|
|
|
|
|
|
- name: List Downloaded Files
|
|
|
|
run: ls -laR ./release
|
|
|
|
|
|
|
|
# - name: Create service_account.json
|
|
|
|
# run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json
|
|
|
|
#
|
|
|
|
# - name: Deploy to Google Play
|
|
|
|
# uses: https://github.com/r0adkll/upload-google-play@v1
|
|
|
|
# with:
|
|
|
|
# serviceAccountJson: service_account.json
|
|
|
|
# packageName: org.askartv.tv
|
|
|
|
# releaseFiles: "./release/*.aab"
|
|
|
|
# debugSymbols: "./release/symbols"
|
|
|
|
# track: production
|
|
|
|
# status: completed
|
|
|
|
# whatsNewDirectory: ./release/whatsnew
|
2024-12-15 04:53:45 +00:00
|
|
|
|