Skip to content

Patch and Upload APK Variants #43

Patch and Upload APK Variants

Patch and Upload APK Variants #43

Workflow file for this run

name: Patch and Upload APK Variants
on:
workflow_dispatch:
inputs:
arm64_v8a_URL:
description: 'Enter arm64-v8a APK URL'
required: true
armeabi_v7a_URL:
description: 'Enter armeabi-v7a APK URL'
required: true
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
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
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
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
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
env:
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
run: |
MESSAGE="🆕 \`${{ github.event.inputs.channel }} ${{ github.event.inputs.version }}\` arm64v8a \\| armeabiv7a"
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"