Skip to content

Added Missing Upload of Combined-ABI APKs in GitHub Actions Workflow; #142

Added Missing Upload of Combined-ABI APKs in GitHub Actions Workflow;

Added Missing Upload of Combined-ABI APKs in GitHub Actions Workflow; #142

# By Abdullah As-Sadeed
name: Build, Release, and Deploy
on:
push:
branches:
- main
jobs:
validate_fastlane_metadata:
name: Validate Fastlane Metadata
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Validate Fastlane Metadata
uses: ashutoshgngwr/validate-fastlane-supply-metadata@v2.1.0
with:
fastlaneDir: ./fastlane/metadata/android
usePlayStoreLocales: true
build_for_linux:
name: Build for Linux
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Setup Flutter
uses: subosito/flutter-action@v2.23.0
with:
channel: stable
flutter-version: 3.41.6
- name: Disable Analytics of Dart and Flutter
run: |
dart --disable-analytics
flutter --disable-analytics
shell: bash
- name: Install Dependencies
run: |
sudo apt update -y
sudo apt install -y ninja-build libgtk-3-dev fuse
shell: bash
- name: Run flutter doctor
run: flutter doctor -v
shell: bash
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Get Dependencies
run: flutter pub get -v
shell: bash
- name: Build for Linux
run: flutter build linux --release
shell: bash
- name: Download appimagetool (x86_64) and Permit Execution
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x ./appimagetool-x86_64.AppImage
shell: bash
- name: Copy Build Artifacts, and Icon into AppDir
run: |
cp -r ./build/linux/x64/release/bundle/* ./Bitscoper_CyberKit.AppDir/
shell: bash
- name: Permit Execution of AppRun and Binary
run: |
chmod +x ./Bitscoper_CyberKit.AppDir/AppRun
chmod +x ./Bitscoper_CyberKit.AppDir/Bitscoper_CyberKit
shell: bash
- name: Get Version
run: echo "VERSION=$(grep '^version:' ./pubspec.yaml | awk '{print $2}')" >> $GITHUB_ENV
shell: bash
- name: Create AppImage and Permit Execution
run: |
APPIMAGE_VERSION=${VERSION%%+*}
mkdir -p ./build/Release/
./appimagetool-x86_64.AppImage ./Bitscoper_CyberKit.AppDir ./build/Release/Bitscoper_CyberKit-$APPIMAGE_VERSION-x64.AppImage
chmod +x ./build/Release/*.AppImage
shell: bash
- name: Rename, Move, and Archive Build Artifacts
run: |
cd ./build/linux/x64/release/bundle/
zip -r ../../../../Release/Linux_x64_Executable.zip ./*
shell: bash
- name: Upload Build Artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: Linux
path: |
build/Release/Linux_x64_Executable.zip
build/Release/*.AppImage
build_for_android:
name: Build for Android
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Setup Flutter
uses: subosito/flutter-action@v2.23.0
with:
channel: stable
flutter-version: 3.41.6
- name: Disable Analytics of Dart and Flutter
run: |
dart --disable-analytics
flutter --disable-analytics
shell: bash
- name: Run flutter doctor
run: flutter doctor -v
shell: bash
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Get Dependencies
run: flutter pub get -v
shell: bash
- name: Patch JNI CMakeLists to Remove build-id
run: sed -i -e 's/-Wl,/-Wl,--build-id=none,/' "${HOME}/.pub-cache/hosted"/*/jni-*/src/CMakeLists.txt
shell: bash
- name: Create key.properties
run: |
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" >> ./android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> ./android/key.properties
echo "keyAlias=Bitscoper_CyberKit" >> ./android/key.properties
echo "storeFile=./KeyStore.jks" >> ./android/key.properties
shell: bash
- name: Create KeyStore.jks
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > ./android/app/KeyStore.jks
shell: bash
- name: Build Signed appbundle
run: flutter build appbundle --release
shell: bash
- name: Build Signed APKs
run: |
flutter build apk --release
flutter build apk --split-per-abi --release
shell: bash
- name: Rename, Move, and Archive Signed Build Artifacts
run: |
mkdir -p ./build/Release/
mv ./build/app/outputs/bundle/release/app-release.aab ./build/Release/Bitscoper_CyberKit-Signed.aab
mv ./build/app/outputs/flutter-apk/app-release.apk ./build/Release/Bitscoper_CyberKit-All_ABIs-Signed.apk
mv ./build/app/outputs/flutter-apk/app-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-All_ABIs-Signed.apk.sha1
mv ./build/app/outputs/flutter-apk/app-x86_64-release.apk ./build/Release/Bitscoper_CyberKit-x86_64-Signed.apk
mv ./build/app/outputs/flutter-apk/app-x86_64-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-x86_64-Signed.apk.sha1
mv ./build/app/outputs/flutter-apk/app-arm64-v8a-release.apk ./build/Release/Bitscoper_CyberKit-ARM64_V8A-Signed.apk
mv ./build/app/outputs/flutter-apk/app-arm64-v8a-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-ARM64_V8A-Signed.apk.sha1
mv ./build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk ./build/Release/Bitscoper_CyberKit-ARMEABI_V7A-Signed.apk
mv ./build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-ARMEABI_V7A-Signed.apk.sha1
rm -rf ./build/app/outputs/*
cd ./build/Release/
zip -r ./Signed_APK_Checksums.zip ./Bitscoper_CyberKit-All_ABIs-Signed.apk.sha1 ./Bitscoper_CyberKit-x86_64-Signed.apk.sha1 ./Bitscoper_CyberKit-ARM64_V8A-Signed.apk.sha1 ./Bitscoper_CyberKit-ARMEABI_V7A-Signed.apk.sha1
shell: bash
- name: Disable Signing
run: sed -r '/signingConfigs.getByName/d ; /signingConfigs \{/,/^ \}/d' -i ./android/app/build.gradle.kts
shell: bash
- name: Build Unsigned appbundle
run: flutter build appbundle --release
shell: bash
- name: Build Unsigned APKs
run: |
flutter build apk --release
flutter build apk --split-per-abi --release
shell: bash
- name: Rename, Move, and Archive Unsigned Build Artifacts
run: |
mkdir -p ./build/Release/
mv ./build/app/outputs/bundle/release/app-release.aab ./build/Release/Bitscoper_CyberKit-Unsigned.aab
mv ./build/app/outputs/flutter-apk/app-release.apk ./build/Release/Bitscoper_CyberKit-All_ABIs-Unsigned.apk
mv ./build/app/outputs/flutter-apk/app-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-All_ABIs-Unsigned.apk.sha1
mv ./build/app/outputs/flutter-apk/app-x86_64-release.apk ./build/Release/Bitscoper_CyberKit-x86_64-Unsigned.apk
mv ./build/app/outputs/flutter-apk/app-x86_64-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-x86_64-Unsigned.apk.sha1
mv ./build/app/outputs/flutter-apk/app-arm64-v8a-release.apk ./build/Release/Bitscoper_CyberKit-ARM64_V8A-Unsigned.apk
mv ./build/app/outputs/flutter-apk/app-arm64-v8a-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-ARM64_V8A-Unsigned.apk.sha1
mv ./build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk ./build/Release/Bitscoper_CyberKit-ARMEABI_V7A-Unsigned.apk
mv ./build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk.sha1 ./build/Release/Bitscoper_CyberKit-ARMEABI_V7A-Unsigned.apk.sha1
rm -rf ./build/app/outputs/*
cd ./build/Release/
zip -r ./Unsigned_APK_Checksums.zip ./Bitscoper_CyberKit-All_ABIs-Unsigned.apk.sha1 ./Bitscoper_CyberKit-x86_64-Unsigned.apk.sha1 ./Bitscoper_CyberKit-ARM64_V8A-Unsigned.apk.sha1 ./Bitscoper_CyberKit-ARMEABI_V7A-Unsigned.apk.sha1
shell: bash
- name: Upload Build Artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: Android
path: |
build/Release/Bitscoper_CyberKit-Signed.aab
build/Release/Bitscoper_CyberKit-All_ABIs-Signed.apk
build/Release/Bitscoper_CyberKit-x86_64-Signed.apk
build/Release/Bitscoper_CyberKit-ARM64_V8A-Signed.apk
build/Release/Bitscoper_CyberKit-ARMEABI_V7A-Signed.apk
build/Release/Signed_APK_Checksums.zip
build/Release/Bitscoper_CyberKit-Unsigned.aab
build/Release/Bitscoper_CyberKit-All_ABIs-Unsigned.apk
build/Release/Bitscoper_CyberKit-x86_64-Unsigned.apk
build/Release/Bitscoper_CyberKit-ARM64_V8A-Unsigned.apk
build/Release/Bitscoper_CyberKit-ARMEABI_V7A-Unsigned.apk
build/Release/Unsigned_APK_Checksums.zip
build_for_macos:
name: Build for macOS
runs-on: macos-26
permissions:
contents: read
steps:
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: "26.4"
- name: Setup Flutter
uses: subosito/flutter-action@v2.23.0
with:
channel: stable
flutter-version: 3.41.6
- name: Disable Analytics of Dart and Flutter
run: |
dart --disable-analytics
flutter --disable-analytics
shell: bash
- name: Run flutter doctor
run: flutter doctor -v
shell: bash
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Get Dependencies
run: flutter pub get -v
shell: bash
- name: Build for macOS
run: flutter build macos --release
shell: bash
- name: Rename, Move, and Archive Build Artifacts
run: |
mkdir -p ./build/Release/
mv ./build/macos/Build/Products/Release/Bitscoper\ CyberKit.app ./build/Release/Bitscoper_CyberKit-macOS.app
cd ./build/Release/
zip -r ./macOS_Executable.zip ./Bitscoper_CyberKit-macOS.app
shell: bash
- name: Upload Build Artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: macOS
path: build/Release/macOS_Executable.zip
build_for_ios:
name: Build for iOS
runs-on: macos-26
permissions:
contents: read
steps:
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: "26.4"
- name: Setup Flutter
uses: subosito/flutter-action@v2.23.0
with:
channel: stable
flutter-version: 3.41.6
- name: Disable Analytics of Dart and Flutter
run: |
dart --disable-analytics
flutter --disable-analytics
shell: bash
- name: Run flutter doctor
run: flutter doctor -v
shell: bash
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Get Dependencies
run: flutter pub get -v
shell: bash
- name: Build iOS Executable
run: flutter build ios --no-codesign --release
shell: bash
# - name: Build IPA
# run: flutter build ipa --no-codesign --release
# shell: bash
- name: Rename Build Artifacts
run: |
mkdir -p ./build/Release/
mv ./build/ios/iphoneos/Runner.app ./build/Release/Bitscoper_CyberKit-iOS.app
cd ./build/Release/
zip -r ./iOS_Executable.zip ./Bitscoper_CyberKit-iOS.app
shell: bash
- name: Upload Build Artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: iOS
path: build/Release/iOS_Executable.zip
build_for_windows:
name: Build for Windows
runs-on: windows-latest
permissions:
contents: read
steps:
- name: Setup Flutter
uses: subosito/flutter-action@v2.23.0
with:
channel: stable
flutter-version: 3.41.6
- name: Disable Analytics of Dart and Flutter
run: |
dart --disable-analytics
flutter --disable-analytics
shell: powershell
- name: Run flutter doctor
run: flutter doctor -v
shell: powershell
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Get Dependencies
run: flutter pub get -v
shell: powershell
- name: Build for Windows
run: dart run msix:create
shell: powershell
- name: Rename, Move, and Archive Build Artifacts
run: |
New-Item -ItemType Directory -Force -Path .\build\Release\
Move-Item -Path .\build\windows\x64\runner\Release\Bitscoper_CyberKit.msix -Destination .\build\Release\Bitscoper_CyberKit.msix
cd .\build\windows\x64\runner\Release\
Compress-Archive -Path .\* -DestinationPath ..\..\..\..\Release\Windows_x64_Executable.zip
shell: powershell
- name: Upload Build Artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: Windows
path: |
build\Release\Windows_x64_Executable.zip
build\Release\Bitscoper_CyberKit.msix
# build_for_web:
# name: Build for Web
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - name: Setup Flutter
# uses: subosito/flutter-action@v2.23.0
# with:
# channel: stable
# flutter-version: 3.41.6
# - name: Disable Analytics of Dart and Flutter
# run: |
# dart --disable-analytics
# flutter --disable-analytics
# shell: bash
# - name: Run flutter doctor
# run: flutter doctor -v
# shell: bash
# - name: Checkout Repository
# uses: actions/checkout@v6.0.2
# - name: Get Dependencies
# run: flutter pub get -v
# shell: bash
# - name: Build for Web
# run: flutter build web --release -v
# shell: bash
# - name: Archive Build Artifacts
# run: |
# mkdir -p ./build/Release/
# cd ./build/web/
# zip -r ../Release/Web_Application.zip ./*
# shell: bash
# - name: Upload Build Artifacts
# uses: actions/upload-artifact@v7.0.1
# with:
# name: Web
# path: build/Release/Web_Application.zip
upload_release:
name: Upload Release
needs: [
build_for_linux,
build_for_android,
build_for_macos,
build_for_ios,
build_for_windows,
# build_for_web,
]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Download All Artifacts
uses: actions/download-artifact@v8.0.1
- name: Get Version
run: echo "VERSION=$(grep '^version:' ./pubspec.yaml | awk '{print $2}')" >> $GITHUB_ENV
shell: bash
- name: Delete Existing Tag and Release (If Any)
run: |
RELEASE_ID=$(curl --silent --show-error --header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/tags/v$VERSION | jq '.id')
if [ "$RELEASE_ID" != "null" ]; then
curl --silent --show-error --header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --request DELETE https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID
git push --delete origin v$VERSION
fi
shell: bash
- name: Create Release
uses: ncipollo/release-action@v1.21.0
with:
artifacts: |
./Linux/Linux_x64_Executable.zip
./Linux/*.AppImage
./Android/Bitscoper_CyberKit-Signed.aab
./Android/Bitscoper_CyberKit-All_ABIs-Signed.apk
./Android/Bitscoper_CyberKit-x86_64-Signed.apk
./Android/Bitscoper_CyberKit-ARM64_V8A-Signed.apk
./Android/Bitscoper_CyberKit-ARMEABI_V7A-Signed.apk
./Android/Signed_APK_Checksums.zip
./Android/Bitscoper_CyberKit-Unsigned.aab
./Android/Bitscoper_CyberKit-All_ABIs-Unsigned.apk
./Android/Bitscoper_CyberKit-x86_64-Unsigned.apk
./Android/Bitscoper_CyberKit-ARM64_V8A-Unsigned.apk
./Android/Bitscoper_CyberKit-ARMEABI_V7A-Unsigned.apk
./Android/Unsigned_APK_Checksums.zip
./macOS/macOS_Executable.zip
./iOS/iOS_Executable.zip
./Windows/Windows_x64_Executable.zip
./Windows/Bitscoper_CyberKit.msix
# ./Web/Release/Web_Application.zip
tag: v${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
update_docker_image:
name: Update Docker Images
needs: [upload_release]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Build and Push Docker Image to GHCR
run: |
docker login --username bitscoper --password ${{secrets.GITHUB_TOKEN}} ghcr.io
docker build . --tag ghcr.io/bitscoper/bitscoper_cyberkit:latest
docker push ghcr.io/bitscoper/bitscoper_cyberkit:latest
shell: bash
# - name: Install Python for AWS CLI
# uses: actions/setup-python@v6.2.0
# with:
# python-version: "3.13"
# - name: Install PIP for AWS CLI
# run: |
# python -m pip install --upgrade pip
# shell: bash
# - name: Install AWS CLI
# run: |
# pip install --upgrade awscli
# shell: bash
# - name: Build and Push Docker Image to Amazon Elastic Container Registry Public Gallery
# run: |
# aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws configure set default.region us-east-1
# aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/n7r2f3q1
# docker build -t bitscoper/bitscoper_cyberkit .
# docker tag bitscoper/bitscoper_cyberkit:latest public.ecr.aws/n7r2f3q1/bitscoper/bitscoper_cyberkit:latest
# docker push public.ecr.aws/n7r2f3q1/bitscoper/bitscoper_cyberkit:latest
# shell: bash
# deploy_web_application_to_server:
# name: Deploy Web Application to Server
# needs: [upload_release]
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v6.0.2
# - name: Setup SSH key
# uses: webfactory/ssh-agent@v0.10.0
# with:
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# - name: Execution
# run: |
# ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -p ${{ secrets.SSH_PORT }} << 'EOF'
# cd /var/www/clients/client1/web1/web/Bitscoper_CyberKit/
# rm -rf ./Application/
# wget https://github.com/bitscoper/bitscoper_cyberkit/releases/latest/download/Web_Application.zip
# unzip ./Web_Application.zip
# rm -rf ./Web_Application.zip
# mv ./Web_Application/ ./Application/
# chown -R web1:client1 /var/www/clients/client1/web1/web/
# chmod -R 755 /var/www/clients/client1/web1/web/
# systemctl restart apache2.service
# exit
# EOF
# shell: bash