Skip to content

Commit

Permalink
👷 (github-action) build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuf007R committed Mar 11, 2024
1 parent e01202d commit 916a0b0
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 17 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 16 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 916a0b0

Please sign in to comment.