Skip to content

Commit

Permalink
Release V0.40 #24
Browse files Browse the repository at this point in the history
  • Loading branch information
susch19 authored Sep 29, 2022
2 parents 0eb1c07 + 38120dc commit f3b23c2
Show file tree
Hide file tree
Showing 66 changed files with 3,839 additions and 2,095 deletions.
140 changes: 140 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: Draft Github Release
on:
workflow_dispatch:
# Enable manual run
pull_request:
branches: [ "master", "develop" ]

jobs:
create-build:
name: Create ${{ matrix.target }} build
runs-on: ${{ matrix.os }}
strategy:
matrix:
target: [Android, Windows, Linux]
include:
- os: windows-2019
target: Windows
build_target: windows
build_path: build\windows\runner\Release
asset_extension: .zip
asset_content_type: application/zip
- os: ubuntu-20.04
target: Linux
build_target: linux
build_path: build/linux/x64/release/bundle
asset_extension: .tar.gz
asset_content_type: application/gzip
- os: ubuntu-20.04
target: Android
build_target: apk
build_path: build/app/outputs/flutter-apk
asset_extension: .apk
asset_content_type: application/vnd.android.package-archive
# Disable fail-fast as we want results from all even if one fails.
fail-fast: false
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@4389e6cbc6cb8a4b18c628ff96ff90be0e926aa8
with:
channel: master

- name: Install Linux dependencies
if: matrix.target == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev
- name: Install Android dependencies
if: matrix.target == 'Android'
uses: actions/setup-java@v1
with:
java-version: '12.x'
- name: Enable desktop support
if: matrix.target != 'Android'
run: |
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
flutter config --enable-windows-desktop
- run: flutter doctor -v


# Checkout NSSL code, recreate missing files, and get packages.
- name: Checkout NSSL code
uses: actions/checkout@v2
- run: flutter create . --project-name nssl --org de.susch19
- run: flutter pub get
- name: Configure Keystore for Android
if: matrix.target == 'Android'
run: |
echo "$KEY_STORE_FILE" | base64 --decode > app/nssl-keystore.jks
echo "storeFile=nssl-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:
KEY_STORE_FILE: ${{ secrets.KEY_STORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
working-directory: android

- name: Create License File Powershell
if: matrix.target == 'Windows'
run: |
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("$Env:SCANDIT_LICENSE_FILE")) > .license.dart
working-directory: lib
env:
SCANDIT_LICENSE_FILE: ${{ secrets.SCANDIT_LICENSE_FILE }}

- name: Create License File Bash
if: matrix.target != 'Windows'
run: |
echo "$SCANDIT_LICENSE_FILE" | base64 --decode > .license.dart
working-directory: lib
env:
SCANDIT_LICENSE_FILE: ${{ secrets.SCANDIT_LICENSE_FILE }}

- name: Create Google Services Json File Bash
if: matrix.target != 'Windows'
run: |
echo "$GOOGLE_SERVICES_JSON" | base64 --decode > google-services.json
working-directory: android/app
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}


# Build the application
- name: Build Flutter Application
run: flutter build -v ${{ matrix.build_target }} --release

- name: Copy SQLite3 Dependency
if: matrix.target == 'Windows'
run: cp .\windows\libs\* ${{ matrix.build_path }}

# Package the build.
- name: Copy VC redistributables to release directory for Windows
if: matrix.target == 'Windows'
run: |
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140_1.dll') .
- name: Rename build for Android
if: matrix.target == 'Android'
run: mv app-release.apk $GITHUB_WORKSPACE/nssl_${{ matrix.target }}.apk
working-directory: ${{ matrix.build_path }}
- name: Compress build for Linux
if: matrix.target == 'Linux'
run: tar czf $GITHUB_WORKSPACE/nssl_${{ matrix.target }}.tar.gz *
working-directory: ${{ matrix.build_path }}
- name: Compress build for Windows
if: matrix.target == 'Windows'
run: compress-archive -Path * -DestinationPath ${env:GITHUB_WORKSPACE}\nssl_${{ matrix.target }}.zip
working-directory: ${{ matrix.build_path }}

# Upload the build.
- name: Add build into artifacts
uses: actions/upload-artifact@v2
with:
name: nssl_${{ matrix.target }}${{ matrix.asset_extension }}
path: ./nssl_${{ matrix.target }}${{ matrix.asset_extension }}
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ packages
pubspec.lock
*.apk
*.keystore
*.properties
.vscode/
.flutter-plugins
.flutter-plugins-dependencies
Expand All @@ -20,4 +21,11 @@ android/app/google-services.json
ios/Flutter/flutter_export_environment.sh
.dart_tool/*
android/app/src/main/java/io/flutter/plugins/*
lib/.license.dart
linux/flutter/generated_plugin_registrant.cc
linux/flutter/generated_plugins.cmake
windows/flutter/generated_plugin_registrant.cc
windows/flutter/generated_plugins.cmake
.license.dart
windows/sqlite3.dll
android/java_pid62552.hprof
ios/Runner/GoogleService-Info.plist
24 changes: 19 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
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 31
compileSdkVersion 33

lintOptions {
checkReleaseBuilds false // Add this
Expand All @@ -29,14 +35,22 @@ android {
resValue "string", "app_name", "NSSL"
multiDexEnabled true
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
}

buildTypes {
signingConfigs {
release {
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
release {
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
Expand Down
23 changes: 21 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.susch19.nssl" android:versionCode="26" android:versionName="0.0.26">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.susch19.nssl" android:versionCode="40" android:versionName="0.40.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher">
<activity android:name="io.flutter.embedding.android.FlutterActivity" android:launchMode="singleTop" android:theme="@android:style/Theme.Black.NoTitleBar" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<activity android:name="io.flutter.embedding.android.FlutterActivity" android:launchMode="singleTask" android:theme="@android:style/Theme.Black.NoTitleBar" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!-- Deep Links -->
<!-- For the "add to shoppinglist" button on chefkoch website-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="api.getbring.com"
android:pathPrefix="/rest/bringrecipes/deeplink" />
</intent-filter>
<!-- Allow to share urls with nssl -->
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>

</activity>
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
Binary file added assets/images/scandit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions assets/vectors/app_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions assets/vectors/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f3b23c2

Please sign in to comment.