Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Build and Release

Build and Release #12

Workflow file for this run

name: "Build and Release"
on:
workflow_dispatch:
branches: main
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
# env:
# BUILD_OFFSET: 10
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.7'
channel: 'stable'
- name: Get Flutter Dependencies
run: flutter pub get
- name: Extract version from pubspec.yaml
run: |
VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}' | cut -d+ -f1)
echo "VERSION=$VERSION" >> $GITHUB_ENV
# - name: Compute build number
# run: |
# BUILD_NUMBER=$((BUILD_OFFSET + GITHUB_RUN_NUMBER))
# echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
- name: Create keystore file
run: |
echo "${{ secrets.ANDROID_RELEASE_KEY }}" | base64 --decode > android/hongeet.jks
- name: Create Keystore properties file
run: |
echo storeFile=../hongeet.jks > android/key.properties
echo keyPassword=${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} >> android/key.properties
echo storePassword=${{ secrets.ANDROID_RELEASE_STORE_PASSWORD }} >> android/key.properties
echo keyAlias=${{ secrets.ANDROID_KEY_ALIAS }} >> android/key.properties
- name: Build GitHub/SF Universal APK
run: flutter build apk --release --flavor github
- name: Build GitHub/SF ARM Split APKs
run: flutter build apk --release --flavor github --split-per-abi --target-platform android-arm64,android-arm
- name: Build Izzy ARM64-only APK
run: flutter build apk --release --flavor izzy --split-per-abi --target-platform android-arm64
- name: Verify Sign
run: |
BUILD_TOOLS=$(ls $ANDROID_HOME/build-tools | sort -r | head -n 1)
APK_DIR=build/app/outputs/flutter-apk
for apk in "$APK_DIR"/app*github*release.apk "$APK_DIR"/app*izzy*release.apk; do
if [ -f "$apk" ]; then
$ANDROID_HOME/build-tools/$BUILD_TOOLS/apksigner verify "$apk"
fi
done
- name: Rename APK files
run: |
APK_DIR=build/app/outputs/flutter-apk
GH_UNIVERSAL=$(find "$APK_DIR" -maxdepth 1 -type f -name "app*github*release.apk" ! -name "*armeabi-v7a*" ! -name "*arm64-v8a*" | head -n 1)
GH_ARMV7=$(find "$APK_DIR" -maxdepth 1 -type f -name "app*github*release.apk" -name "*armeabi-v7a*" | head -n 1)
GH_ARM64=$(find "$APK_DIR" -maxdepth 1 -type f -name "app*github*release.apk" -name "*arm64-v8a*" | head -n 1)
IZZY_ARM64=$(find "$APK_DIR" -maxdepth 1 -type f -name "app*izzy*release.apk" -name "*arm64-v8a*" | head -n 1)
test -n "$GH_UNIVERSAL" || (echo "GitHub universal APK not found" && exit 1)
test -n "$GH_ARMV7" || (echo "GitHub armeabi-v7a APK not found" && exit 1)
test -n "$GH_ARM64" || (echo "GitHub arm64-v8a APK not found" && exit 1)
test -n "$IZZY_ARM64" || (echo "Izzy arm64-v8a APK not found" && exit 1)
mv "$GH_UNIVERSAL" "$APK_DIR/hongeet_v${VERSION}_universal.apk"
mv "$GH_ARMV7" "$APK_DIR/hongeet_v${VERSION}_armeabi-v7a.apk"
mv "$GH_ARM64" "$APK_DIR/hongeet_v${VERSION}_arm64-v8a.apk"
mv "$IZZY_ARM64" "$APK_DIR/hongeet_v${VERSION}_izzy_arm64-v8a.apk"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Release-GH-SF
path: |
build/app/outputs/flutter-apk/hongeet_v*_universal.apk
build/app/outputs/flutter-apk/hongeet_v*_armeabi-v7a.apk
build/app/outputs/flutter-apk/hongeet_v*_arm64-v8a.apk
!build/app/outputs/flutter-apk/hongeet_v*_izzy_arm64-v8a.apk
- name: Upload Izzy Artifact
uses: actions/upload-artifact@v4
with:
name: Release-Izzy
path: |
build/app/outputs/flutter-apk/hongeet_v*_izzy_arm64-v8a.apk
# - name: Create GitHub Release
# uses: ncipollo/release-action@v1
# with:
# artifacts: |
# build/app/outputs/flutter-apk/hongeet_v${{ env.VERSION }}_universal.apk
# build/app/outputs/flutter-apk/hongeet_v${{ env.VERSION }}_armeabi-v7a.apk
# build/app/outputs/flutter-apk/hongeet_v${{ env.VERSION }}_arm64-v8a.apk
# tag: v${{ env.VERSION }}
# token: ${{ secrets.GITHUB_TOKEN }}
# prerelease: false