diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca8d1378..7885c2ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,25 +86,29 @@ jobs: - name: Generate app icons run: dart run flutter_launcher_icons - - name: Setup Keystore - run: | - echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/upload-keystore.jks - echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties - echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties - echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties - echo "storeFile=app/upload-keystore.jks" >> android/key.properties - cat android/key.properties - - - name: Build APK (Release) + - name: Build APK (Release - unsigned) run: flutter build apk --release --split-per-abi + - name: Sign APKs + uses: r0adkll/sign-android-release@v1 + id: sign_arm64 + with: + releaseDirectory: build/app/outputs/flutter-apk + signingKeyBase64: ${{ secrets.KEYSTORE_BASE64 }} + alias: ${{ secrets.KEY_ALIAS }} + keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + BUILD_TOOLS_VERSION: "34.0.0" + - name: Rename APKs run: | VERSION=${{ needs.get-version.outputs.version }} cd build/app/outputs/flutter-apk - mv app-arm64-v8a-release.apk SpotiFLAC-${VERSION}-arm64.apk || true - mv app-armeabi-v7a-release.apk SpotiFLAC-${VERSION}-arm32.apk || true - mv app-release.apk SpotiFLAC-${VERSION}-universal.apk || true + # Signed files have -signed suffix + mv app-arm64-v8a-release-signed.apk SpotiFLAC-${VERSION}-arm64.apk || mv app-arm64-v8a-release.apk SpotiFLAC-${VERSION}-arm64.apk || true + mv app-armeabi-v7a-release-signed.apk SpotiFLAC-${VERSION}-arm32.apk || mv app-armeabi-v7a-release.apk SpotiFLAC-${VERSION}-arm32.apk || true + mv app-release-signed.apk SpotiFLAC-${VERSION}-universal.apk || mv app-release.apk SpotiFLAC-${VERSION}-universal.apk || true ls -la - name: Upload APK artifact diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index a2aeff89..1faffac7 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -5,7 +5,7 @@ plugins { id("dev.flutter.flutter-gradle-plugin") } -// Load keystore properties from key.properties file +// Load keystore properties for local builds val keystorePropertiesFile = rootProject.file("key.properties") val keystoreProperties = java.util.Properties() if (keystorePropertiesFile.exists()) { @@ -55,6 +55,8 @@ android { buildTypes { release { + // For local builds: use release signing if key.properties exists + // For CI builds: APK is signed by GitHub Action after build signingConfig = if (keystorePropertiesFile.exists()) { signingConfigs.getByName("release") } else { diff --git a/lib/constants/app_info.dart b/lib/constants/app_info.dart index 4b0724bf..973f36b4 100644 --- a/lib/constants/app_info.dart +++ b/lib/constants/app_info.dart @@ -1,8 +1,8 @@ /// App version and info constants /// Update version here only - all other files will reference this class AppInfo { - static const String version = '1.5.0-hotfix5'; - static const String buildNumber = '19'; + static const String version = '1.5.0-hotfix6'; + static const String buildNumber = '20'; static const String fullVersion = '$version+$buildNumber'; static const String appName = 'SpotiFLAC'; diff --git a/pubspec.yaml b/pubspec.yaml index 7a027e03..7db3f306 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: spotiflac_android description: Download Spotify tracks in FLAC from Tidal, Qobuz & Amazon Music publish_to: 'none' -version: 1.5.0+19 +version: 1.5.0+20 environment: sdk: ^3.10.0