Skip to content

Commit

Permalink
Merge pull request #148 from osociety/dev
Browse files Browse the repository at this point in the history
Preparing to release 1.0.5
  • Loading branch information
git-elliot authored Mar 30, 2024
2 parents 992df16 + 7217d23 commit c5fdf87
Show file tree
Hide file tree
Showing 55 changed files with 308 additions and 58 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/flutter_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Download pub dependencies
run: flutter pub get

- name: Upgrade pub dependencies
run: flutter pub upgrade

- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs

Expand Down Expand Up @@ -100,6 +103,33 @@ jobs:
with:
files: ${{ vars.LINUX_BUILD_PATH }}/${{ env.LINUX_ZIP }}

- name: Build Android App Bundle
run: flutter build appbundle --flavor store

- name: 'Setup Ruby, JRuby and TruffleRuby'
uses: ruby/[email protected]
with:
ruby-version: 3.1.2

- name: Cache bundle dependencies
uses: actions/cache@v2
with:
path: vendor/bundle
key: '${{ runner.os }}-gems-${{ hashFiles(''**/Gemfile.lock'') }}'
restore-keys: '${{ runner.os }}-gems-'

- name: Download bundle dependencies
run: |
gem install bundler:2.3.20
bundle config path vendor/bundle
bundle install
- name: Release to Google Play
env:
SUPPLY_PACKAGE_NAME: '${{ secrets.ANDROID_PACKAGE_NAME }}'
SUPPLY_JSON_KEY_DATA: '${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}'
run: bundle exec fastlane android deploy

release-macos:
runs-on: macos-latest
env:
Expand All @@ -116,6 +146,9 @@ jobs:
- name: Download pub dependencies
run: flutter pub get

- name: Upgrade pub dependencies
run: flutter pub upgrade

- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs

Expand Down Expand Up @@ -153,6 +186,9 @@ jobs:

- name: Download pub dependencies
run: flutter pub get

- name: Upgrade pub dependencies
run: flutter pub upgrade

- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs
Expand Down
50 changes: 46 additions & 4 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,39 @@ concurrency:
cancel-in-progress: true

jobs:
build:
name: 'Flutter Test'
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
lib: ${{ steps.filter.outputs.lib }}
test: ${{ steps.filter.outputs.test }}
android: ${{ steps.filter.outputs.android }}
linux: ${{ steps.filter.outputs.linux }}
macos: ${{ steps.filter.outputs.macos }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
lib:
- 'lib/**'
android:
- 'android/**'
test:
- 'test/**'
linux:
- 'linux/**'
macos:
- 'macos/**'
android-linux-build:
name: 'Android / Linux Build'
needs: changes
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -53,12 +84,23 @@ jobs:
build-runner-
- name: Download pub dependencies
run: flutter pub get
- name: Upgrade pub dependencies
run: flutter pub upgrade
- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Run analyzer
run: flutter analyze
- name: Run tests
run: flutter test
- name: Build dev debug flavor
- name: Build Android
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true'}}
run: |
flutter build apk --debug --flavor dev
flutter build apk --debug --flavor dev
# Run only if test, lib, and linux folder is changed
- name: Install Linux dependencies
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true'}}
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Build Linux
if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true'}}
run: flutter build linux
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,8 @@ app.*.symbols
# Android Studio will place build artifacts here
android/app/debug
android/app/profile
android/app/release
android/app/release

# gem files
android/.bundle
android/vendor
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Vernet - Network Analyzer and Monitoring Tool

## Features

1. Shows Wi-Fi details
1. Shows Wi-Fi details such as BSSID and MAC Address.
2. Scans for devices(or hosts) on network
3. Scans for open ports of target IP
4. Shows ISP details
Expand Down
3 changes: 3 additions & 0 deletions android/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
37 changes: 18 additions & 19 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

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'
Expand All @@ -21,26 +22,22 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion 34
compileSdk 34

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "org.fsociety.vernet"
minSdkVersion 19
minSdkVersion 24
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand All @@ -62,7 +59,7 @@ android {
}
}

flavorDimensions "deploy"
flavorDimensions = ["deploy"]

productFlavors {
dev {
Expand All @@ -81,15 +78,17 @@ android {
versionNameSuffix "-store"
}
}
lint {
checkReleaseBuilds false

namespace "org.fsociety.vernet"
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
}
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fsociety.vernet">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fsociety.vernet">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fsociety.vernet">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
28 changes: 14 additions & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
buildscript {
ext.kotlin_version = '1.9.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
}
// Fix for Gradle Error.
// Namespace not specified. Specify a namespace in the module's build file
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
}

rootProject.buildDir = '../build'
Expand All @@ -26,4 +26,4 @@ subprojects {

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
}
2 changes: 2 additions & 0 deletions android/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
json_key_file("/Users/paras/Development/keys/pc-api-8425228000688621147-853-39b50356df30.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("org.fsociety.vernet.store") # e.g. com.krausefx.app
36 changes: 36 additions & 0 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:android)

platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end

desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
upload_to_play_store(track: 'beta', aab: '../build/app/outputs/bundle/storeRelease/app-store-release.aab')

# sh "your_script.sh"
# You can also use other beta testing services here
end

desc "Deploy a new version to the Google Play"
lane :deploy do
upload_to_play_store(aab: '../build/app/outputs/bundle/storeRelease/app-store-release.aab')
end
end
48 changes: 48 additions & 0 deletions android/fastlane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
fastlane documentation
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```sh
xcode-select --install
```

For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

## Android

### android test

```sh
[bundle exec] fastlane android test
```

Runs all the tests

### android beta

```sh
[bundle exec] fastlane android beta
```

Submit a new Beta Build to Crashlytics Beta

### android deploy

```sh
[bundle exec] fastlane android deploy
```

Deploy a new version to the Google Play

----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/en-US/changelogs/1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only host scanner, port scanner and ping is supported.
Loading

0 comments on commit c5fdf87

Please sign in to comment.