Patch and Upload APK Variants #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Patch and Upload APK Variants | |
on: | |
workflow_dispatch: | |
inputs: | |
arm64_v8a_URL: | |
description: 'Enter arm64-v8a APK URL' | |
required: false | |
armeabi_v7a_URL: | |
description: 'Enter armeabi-v7a APK URL' | |
required: false | |
version: | |
description: 'Enter the version number:' | |
required: true | |
channel: | |
description: 'Enter Channel: alpha beta stable' | |
required: true | |
jobs: | |
patch-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Download IGExperimentsPatcher and uber-apk-signer | |
run: | | |
wget --show-progress -q --progress=bar:force:noscroll https://github.com/xHookman/IGExperimentsPatcher/releases/download/1.2/IGExperimentsPatcher.jar -O IGExperimentsPatcher.jar | |
wget --show-progress -q --progress=bar:force:noscroll https://github.com/patrickfav/uber-apk-signer/releases/download/v1.3.0/uber-apk-signer-1.3.0.jar -O uber-apk-signer.jar | |
- name: Patch and Sign arm64-v8a APK | |
if: ${{ github.event.inputs.arm64_v8a_URL != '' }} | |
run: | | |
wget --show-progress -q --progress=bar:force:noscroll "${{ github.event.inputs.arm64_v8a_URL }}" -O arm64-v8a_${{ github.event.inputs.version }}.apk | |
java -jar IGExperimentsPatcher.jar -p arm64-v8a_${{ github.event.inputs.version }}.apk | |
java -jar uber-apk-signer.jar -a arm64-v8a_${{ github.event.inputs.version }}-patched.apk | |
- name: Upload arm64-v8a Artifact | |
if: ${{ github.event.inputs.arm64_v8a_URL != '' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: arm64-v8a_${{ github.event.inputs.version }} | |
path: arm64-v8a_${{ github.event.inputs.version }}-patched-aligned-debugSigned.apk | |
- name: Patch and Sign armeabi-v7a APK | |
if: ${{ github.event.inputs.armeabi_v7a_URL != '' }} | |
run: | | |
wget --show-progress -q --progress=bar:force:noscroll "${{ github.event.inputs.armeabi_v7a_URL }}" -O armeabi-v7a_${{ github.event.inputs.version }}.apk | |
java -jar IGExperimentsPatcher.jar -p armeabi-v7a_${{ github.event.inputs.version }}.apk | |
java -jar uber-apk-signer.jar -a armeabi-v7a_${{ github.event.inputs.version }}-patched.apk | |
- name: Upload armeabi-v7a Artifact | |
if: ${{ github.event.inputs.armeabi_v7a_URL != '' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: armeabi-v7a_${{ github.event.inputs.version }} | |
path: armeabi-v7a_${{ github.event.inputs.version }}-patched-aligned-debugSigned.apk | |
- name: Send message to Telegram | |
if: ${{ github.event.inputs.arm64_v8a_URL != '' || github.event.inputs.armeabi_v7a_URL != '' }} | |
env: | |
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} | |
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }} | |
run: | | |
ARM64V8A_MESSAGE="" | |
ARMEABIV7A_MESSAGE="" | |
if [[ -n "${{ github.event.inputs.arm64_v8a_URL }}" ]]; then | |
ARM64V8A_MESSAGE="arm64v8a" | |
fi | |
if [[ -n "${{ github.event.inputs.armeabi_v7a_URL }}" ]]; then | |
ARMEABIV7A_MESSAGE="armeabiv7a" | |
fi | |
MESSAGE="🆕 \`${{ github.event.inputs.channel }} ${{ github.event.inputs.version }}\` $ARM64V8A_MESSAGE \\| $ARMEABIV7A_MESSAGE" | |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
KEYBOARD='{"inline_keyboard":[[{"text":"Download","url":"'"$RUN_URL"'"}]]}' | |
curl -s -X POST "https://api.telegram.org/bot$TG_BOT_TOKEN/sendMessage" \ | |
-d chat_id="$TG_CHAT_ID" \ | |
-d text="$MESSAGE" \ | |
-d parse_mode="MarkdownV2" \ | |
-d reply_markup="$KEYBOARD" |