diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95b8d71..811f16f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,17 +9,32 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: generate files from secret + run: | + echo '{"SENTRY_DSN":"$SENTRY_DNS","DANBOORU_URL":"$DANBOORU_URL","STAGE":"$STAGE"}' >> env.json + cd android + echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/keystore.jks + echo "storeFile=keystore.jks" >> key.properties + echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties + echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties + echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties + env: + PLAY_STORE_UPLOAD_KEY: ${{ secrets.BOORU_POCKET_KEY }} + KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} + KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} + KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} + SENTRY_DNS: ${{ secrets.SENTRY_DNS }} + DANBOORU_URL: ${{ secrets.DANBOORU_URL }} + STAGE: ${{ secrets.STAGE }} + - uses: subosito/flutter-action@@v2 with: - distribution: "zulu" - java-version: "11" - - uses: subosito/flutter-action@v1 - with: - channel: "beta" + channel: "stable" + flutter-version: "3.19.3" + cache: true - run: flutter pub get - - run: flutter build apk + - run: flutter build appbundle --dart-define-from-file=env.json - uses: actions/upload-artifact@v1 with: - name: release-apk - path: build/app/outputs/apk/release/app-release.apk + name: release-aab + path: build/app/outputs/apk/release/app-release.aab diff --git a/android/app/build.gradle b/android/app/build.gradle index 5b80637..b5715b7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -22,6 +22,13 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } + +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + android { namespace "com.yusuf007r.booru_pocket" compileSdk 34 @@ -50,12 +57,18 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release } } } diff --git a/android/build.gradle b/android/build.gradle index bc157bd..2bf1089 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,8 +1,14 @@ -allprojects { +buildscript { + ext.kotlin_version = '1.8.0' repositories { google() mavenCentral() } + + dependencies { + classpath 'com.android.tools.build:gradle:7.4.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } } rootProject.buildDir = '../build' diff --git a/pubspec.lock b/pubspec.lock index 0071285..c42feaa 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1223,5 +1223,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <=3.3.2" - flutter: ">=3.19.0" + dart: "3.3.1" + flutter: ">=3.19.3" diff --git a/pubspec.yaml b/pubspec.yaml index b154327..e09bf32 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,8 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.3+4 environment: - sdk: ">=3.0.0 <=3.3.2" + sdk: 3.3.1 + flutter: 3.19.3 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions