Skip to content

Instantly share code, notes, and snippets.

@nooralibutt
Last active April 17, 2023 05:50
Show Gist options
  • Save nooralibutt/3b5a35f4a57097a530f7c059719a3d5a to your computer and use it in GitHub Desktop.
Save nooralibutt/3b5a35f4a57097a530f7c059719a3d5a to your computer and use it in GitHub Desktop.
Release settings

Requirements

  • Running app (with master branch upto date)
  • bundle id
  • key.properties
  • keystore
  • Account name
  • json file on github.io
  • Ad Ids (Optional)

Prerequisites

  • Check repository secret token
  • .github/workflows/main.yaml should exist in master branch
  • No Pending PRs
  • master branch should exist
  • ad ids are there in ad id manager
  • make sure test ads are displayed in debug mode and production ads in live mode
  • Check manifest file android/app/src/main/AndroidManifest.xml Make sure test app id is mentioned in com.google.android.gms.ads.APPLICATION_ID with id ca-app-pub-3940256099942544~3347511713
  • Check app name (should be less than 13 characters) at android/app/src/main/AndroidManifest.xml
  • Check app_icon if it exists at android/app/src/main/res/drawable/app_icon.png
  • app_icon should exist in drawables and mipmap folders android/app/src/main/res/mipmap
  • Check Native Splash android/app/src/main/res/drawable-hdpi/splash.png
  • Check bundle id should be example one in master branch android/app/src/main/AndroidManifest.xml
  • Check read me
  • Check if json file is in appropriate account folder https://github.com/nooralibutt/nooralibutt.github.io

Steps

  1. Make sure you commit after each step
  2. Create release branch from master and don’t publish it. If release already exist, update from master.
  3. Change app/build.gradle file
  4. Add dependency change_app_package_name: ^1.1.0
  5. flutter pub run change_app_package_name:main
  6. Add keystore file to root of project
  7. Create key.properties in android root and update its values according to your settings
  8. Make sure you add key.properties manually to git
  9. Update admob app id from ad id manager to manifest
  10. Push the changes and make sure in github actions that build is running
  11. Make sure build is available in releases in github
  12. Update bundle id, android approving: true and interstitial count: 5 in https://github.com/nooralibutt/nooralibutt.github.io

Mediation Steps

  1. Update your gradle settings settings.gradle (Android only)
  2. Add dependencies for partner networks in app level build.gradle
  3. (iOS Only) Add to your Podfile (Optionally)
pod 'GoogleMobileAdsMediationAdColony'
pod 'GoogleMobileAdsMediationChartboost'
pod 'GoogleMobileAdsMediationIronSource'
pod 'GoogleMobileAdsMediationVungle'
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.example.bundle.id"
minSdkVersion 21
targetSdkVersion 33
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 {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
repositories {
google()
mavenCentral()
maven {
url 'https://android-sdk.is.com/'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.ads.mediation:adcolony:4.8.0.1'
implementation 'com.google.ads.mediation:chartboost:9.2.1.0'
implementation 'com.google.ads.mediation:vungle:6.12.1.0'
}
# <img src="/assets/icon.png" alt="App Icon" style="height: 50px; width:50px;"/> relaxing app hanzla 2023
This app is made by Hanzla Waheed in January 2023
Uploaded to **kitchen scale account**
[Remote Config](https://github.com/nooralibutt/nooralibutt.github.io/blob/master/com.balance.slimeatory.calm.mood.cc.json)
## Splash
<img src="/assets/splash.png" alt="Splash" style="height: 200px; width:117px;"/>
storePassword=gameslots123
keyPassword=gameslots123
keyAlias=gameslots
storeFile=../../callofdutywallsgameslots1.keystore
on:
push:
branches:
- release
name: Build & Release
jobs:
build:
name: Build APK & IPA
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '3.7.0'
- run: flutter pub get
- run: flutter build appbundle --build-name=1.0.${{ github.run_number }} --build-number=${{ github.run_number }}
- name: Push to Releases
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/bundle/release/app-release.aab"
tag: v1.0.${{ github.run_number }}
token: ${{ secrets.TOKEN }}
...
...
...
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withInputStream { stream -> plugins.load(stream) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment