Skip to content

Commit

Permalink
I have no idea if it's gonna work
Browse files Browse the repository at this point in the history
  • Loading branch information
atomic-junky committed Jun 7, 2024
1 parent 250aa58 commit 1563c07
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 53 deletions.
75 changes: 35 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,47 @@ on:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
build_ios:
permissions: write-all
name: Build Flutter (iOS)
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '17.x'
java-package: jdk
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get
- run: flutter clean
- run: flutter build ios --release --no-codesign
- name: Create iPA
run: |
cd build/ios/iphoneos/ && mkdir -p Payload &&
mv Runner.app Payload/ && zip -r app.ipa Payload && ls
- name: Upload iPA
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
name: Catsuka ${{ github.ref_name }}
tag: ${{ github.ref_name }}
artifacts: build/ios/iphoneos/*.ipa
replacesArtifacts: true
allowUpdates: true
jobs:
build_apk:
permissions: write-all
name: Build Flutter (Android)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v4

- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '17.x'
java-package: jdk
- uses: subosito/flutter-action@v1
java-version: '21'

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Create the Keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: |
# import keystore from secrets
echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/key.keystore
- name: Get dependencies
run: flutter pub get

- name: Build Android App Bundle
run: flutter build apk --release --split-per-abi

- name: Sign app APK
id: sign_app
uses: ilharp/sign-android-release@nightly
with:
channel: 'stable'
- run: flutter pub get
- run: flutter build apk --release --split-per-abi
releaseDir: build/app/outputs/apk/release
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Upload APK
uses: ncipollo/[email protected]
with:
Expand All @@ -60,4 +55,4 @@ jobs:
tag: ${{ github.ref_name }}
artifacts: build/app/outputs/apk/release/*.apk
replacesArtifacts: true
allowUpdates: true
allowUpdates: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# Keystore
*.keystore
key.properties
12 changes: 2 additions & 10 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '21'
}

sourceSets {
Expand All @@ -54,14 +54,6 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

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
}
}
}

flutter {
Expand All @@ -71,4 +63,4 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
}
}
10 changes: 8 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.8.22'
ext.kotlin_version = '1.9.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.android.tools.build:gradle:8.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -29,3 +29,9 @@ subprojects {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

buildTypes {
release {
signingConfig null
}
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip

0 comments on commit 1563c07

Please sign in to comment.