mirror of
https://github.com/meowarex/rl-mobile.git
synced 2026-06-17 21:13:11 +10:00
90 lines
2.7 KiB
YAML
90 lines
2.7 KiB
YAML
name: "[main] Release"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "**/*.md"
|
|
|
|
jobs:
|
|
Version:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.set.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- id: set
|
|
run: |
|
|
BASE=$(cat .version | tr -d '[:space:]')
|
|
echo "version=$BASE.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
|
|
|
Build:
|
|
needs: Version
|
|
uses: ./.github/workflows/build.yml
|
|
with:
|
|
version: ${{ needs.Version.outputs.version }}
|
|
secrets: inherit
|
|
|
|
Release:
|
|
name: Publish Release
|
|
needs: [Version, Build]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: rl-mobile-artifacts
|
|
path: ./dist/
|
|
|
|
- name: Prepare release assets
|
|
run: |
|
|
mv ./dist/app-release.apk ./dist/rl-manager.apk
|
|
cp patches/data.json ./dist/data.json
|
|
cd patches && zip -r ../dist/patches.zip . -x "data.json" && cd ..
|
|
|
|
tidal_src=$(find tidal-apk -maxdepth 1 \( -name "*.apk" -o -name "*.apkm" \) | head -1)
|
|
if [ -z "$tidal_src" ]; then
|
|
echo "::error::No TIDAL .apk or .apkm found in tidal-apk/"
|
|
exit 1
|
|
fi
|
|
if [[ "$tidal_src" == *.apkm ]]; then
|
|
echo "Extracting & merging splits from $tidal_src"
|
|
workdir=$(mktemp -d)
|
|
unzip -q "$tidal_src" -d "$workdir"
|
|
cp "$workdir/base.apk" ./dist/tidal-stock.apk
|
|
|
|
# Merge native libs from arm64-v8a split into base.apk
|
|
for split in "$workdir"/split_config.arm64_v8a.apk \
|
|
"$workdir"/split_config.xxhdpi.apk \
|
|
"$workdir"/split_config.en.apk; do
|
|
[ -f "$split" ] || continue
|
|
echo "Merging $(basename "$split")"
|
|
libdir=$(mktemp -d)
|
|
unzip -q "$split" -d "$libdir"
|
|
# Drop META-INF (signatures) and the split's manifest
|
|
rm -rf "$libdir/META-INF" "$libdir/AndroidManifest.xml"
|
|
(cd "$libdir" && zip -qr "$OLDPWD/dist/tidal-stock.apk" .)
|
|
rm -rf "$libdir"
|
|
done
|
|
rm -rf "$workdir"
|
|
else
|
|
cp "$tidal_src" ./dist/tidal-stock.apk
|
|
fi
|
|
|
|
- name: Publish release
|
|
uses: marvinpinto/action-automatic-releases@latest
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
automatic_release_tag: latest
|
|
prerelease: false
|
|
title: v${{ needs.Version.outputs.version }}
|
|
files: ./dist/**
|