Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from iamalper/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
iamalper authored Dec 15, 2023
2 parents 8a413f3 + 1a27821 commit eb208e3
Show file tree
Hide file tree
Showing 111 changed files with 1,539 additions and 2,733 deletions.
77 changes: 37 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ jobs:
uses: actions/download-artifact@v2
with:
name: gitversion

- name: Create new file without newline char from version.txt
run: tr -d '\n' < version.txt > version1.txt

- name: Read version
id: version
uses: juliangruber/read-file-action@v1
with:
path: version1.txt
path: version.txt

- name: Update version in pubpsec.yaml
run: sed -i 's/1.0.0+1/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml
Expand Down Expand Up @@ -66,8 +63,6 @@ jobs:
channel: 'stable'
cache: true

- name: Running flutter tests
run: flutter test

- name: Start appbundle build
run: flutter build appbundle
Expand All @@ -78,10 +73,11 @@ jobs:
- name: Uploading android packages
uses: actions/upload-artifact@v2
with:
name: builds
name: android
path: |
build/app/outputs/flutter-apk/app-release.apk
build/app/outputs/bundle/release/app-release.aab
if-no-files-found: error

build_linux:
needs: [version]
Expand All @@ -93,15 +89,12 @@ jobs:
uses: actions/download-artifact@v2
with:
name: gitversion

- name: Create new file without newline char from version.txt
run: tr -d '\n' < version.txt > version1.txt

- name: Read version
id: version
uses: juliangruber/read-file-action@v1
with:
path: version1.txt
path: version.txt

- name: Update version in pubpsec.yaml
run: sed -i 's/1.0.0+1/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml
Expand All @@ -128,7 +121,7 @@ jobs:
- run: flutter config --enable-linux-desktop

- name: Running flutter tests
run: flutter test
run: xvfb-run flutter test integration_test/app_test.dart

- name: Start linux build
run: flutter build linux
Expand All @@ -139,13 +132,14 @@ jobs:
- name: Upload deb package
uses: actions/upload-artifact@v2
with:
name: builds
name: linux
path: |
build/linux/x64/release/debian/*.deb
if-no-files-found: error

build_windows: #Not implemented
build_windows:
runs-on: windows-latest
if: false
needs: version
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
Expand All @@ -159,60 +153,59 @@ jobs:
uses: actions/download-artifact@v2
with:
name: gitversion

- name: Create new file without newline char from version.txt
run: tr -d '\n' < version.txt > version1.txt

- name: Read version
id: version
uses: juliangruber/read-file-action@v1
with:
path: version1.txt
path: version.txt

- name: Update version in pubpsec.yaml
run: sed -i 's/1.0.0+1/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml

- run: flutter config --enable-windows-desktop

- name: Running flutter tests
run: flutter test
run: flutter test integration_test\app_test.dart

- name: Build for windows
run: flutter build windows

- name: Upload exe
- name: Upload build folder
uses: actions/upload-artifact@v2
with:
name: builds
name: windows
path: |
build/linux/x64/release/debian/*.deb
build\windows\x64\runner\Release
if-no-files-found: error

release:
env:
isRelease: ${{ github.ref_name == 'main' }}
runs-on: ubuntu-latest
needs: [build_android, build_linux, version]
needs: [build_android, build_linux, version, build_windows]
steps:
- uses: actions/checkout@v3

- name: Downloading builds
uses: actions/download-artifact@v3
with:
name: builds

- name: Get version.txt
uses: actions/download-artifact@v2
with:
name: gitversion

- name: Create new file without newline char from version.txt
run: tr -d '\n' < version.txt > version1.txt

- name: Read version
id: version
uses: juliangruber/read-file-action@v1
with:
path: version1.txt
path: gitversion/version.txt

- name: Rename files
run: |
mv android/flutter-apk/app-release.apk FileDrop-${{ steps.version.outputs.content }}.apk
mv android/bundle/release/app-release.aab FileDrop-${{ steps.version.outputs.content }}.aab
- name: Zip windows folder
uses: "vimtor/[email protected]"
with:
files: windows
dest: windows.zip

- name: Releasing builds
uses: "marvinpinto/[email protected]"
Expand All @@ -221,9 +214,10 @@ jobs:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: ${{ env.isRelease == 'false' }}
files: |
flutter-apk/app-release.apk
bundle/release/app-release.aab
*.deb
*.apk
*.aab
linux/*.deb
windows.zip
version:
name: Create version number
Expand All @@ -243,7 +237,10 @@ jobs:
uses: gittools/actions/gitversion/[email protected]

- name: Create version.txt with MajorMinorPatch
run: echo ${{ steps.gitversion.outputs.MajorMinorPatch }}${{ steps.gitversion.outputs.PreReleaseTagWithDash }} > version.txt
run: echo ${{ steps.gitversion.outputs.majorMinorPatch }}${{ steps.gitversion.outputs.PreReleaseTagWithDash }} > version_nw.txt

- name: Create new file without newline char from version.txt
run: tr -d '\n' < version_nw.txt > version.txt

- name: Upload version.txt
uses: actions/upload-artifact@v2
Expand All @@ -260,7 +257,7 @@ jobs:
- name: Downloading builds
uses: actions/download-artifact@v3
with:
name: builds
name: android

- name: Publishing
uses: r0adkll/upload-google-play@v1
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
/android/app/release

/temp-test
25 changes: 8 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ You can get .deb packages from <a href="https://github.com/iamalper/weepy/releas
<a href='https://play.google.com/store/apps/details?id=com.alper.weepy&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img style="height: 40%; width: 40%" alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/></a>

Or you can get **.apk** or **.aab** packages from <a href="https://github.com/iamalper/weepy/releases">Releases</a>
### Windows, Mac OS, IOS
I don't ship packages or test for these platfroms, homever you can build yourself.
### Web
I can't find a way for accessing local networks from browsers. If you build for web, it has no functionalty.
### Windows
Windows packages not tested, but you can get them from <a href="https://github.com/iamalper/weepy/releases">Releases</a> in windows.zip

*For other platforms, PR's welcomed but i don't have any plans to support them.*
## Build
It is a flutter project so if you have **flutter** installed, you can build with `flutter build` from repo directory.
If not, see <a href=https://docs.flutter.dev/get-started/install>Flutter docs: Install</a>
Expand All @@ -28,16 +27,8 @@ For Android release build, you need to create your keystore and **key.properties

Also you can set your **lib/firebase_options.dart** or crash reports will sent to my firebase console.
## Contribution
I am not much experienced at Flutter so any advice or pull request welcomed (even typos in README or code comments).

Also you can help with improving translations or translating another languages with committing in **lib/l10** folder.
### TODO
- [x] Handle connection lost while transfer and show proper error dialog
- [x] Convert throw types from `String` to `enum` or `exception`
- [x] Convert UI states from `integer` to `enum`
- [x] Add setting for opt-out crash reporting
- [ ] Add setting for change to system theme
- [ ] Add logs for crash reporting
- [ ] Find a way to build for windows in actions script
- [x] Improve action script for publishing to google play
- [ ] Show builds in github pages instead of just privacy policy text
Thank you, if you are interesting for contributing.

Any PR or ideas welcomed. Please commit to develop branch. I am keeping main branch more stable and automatically published to Google Play testers.

You can contribute with solving issues from Issues tab, tweaking UI, improving translations or translating another languages (with committing in **lib/l10** folder).
7 changes: 7 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
//flutter_local_notifications
coreLibraryDesugaringEnabled true
//------
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand Down Expand Up @@ -93,4 +96,8 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:2.0.1'
//for flutter_local_notifications
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
}
30 changes: 29 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
-keep class androidx.lifecycle.DefaultLifecycleObserver
-keep class androidx.lifecycle.DefaultLifecycleObserver

## flutter_local_notification
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
4 changes: 4 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
android:requestLegacyExternalStorage="true">
<!-- Need for API level 29. Scoped Storage has some issue in Android 10. So, google recommanded to add this. -->
<!-- Read more from here: https://developer.android.com/training/data-storage/shared/media#access-other-apps-files-->

<!--for flutter_local_notifications-->
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ActionBroadcastReceiver" />

<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.9.21'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:7.3.1'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand Down
File renamed without changes
File renamed without changes
Loading

0 comments on commit eb208e3

Please sign in to comment.