Skip to content

Commit

Permalink
Merge pull request #1 from ConcenTech/0.2.1
Browse files Browse the repository at this point in the history
0.2.1
  • Loading branch information
KevMCarp authored Sep 20, 2024
2 parents 24e8e62 + a2714d9 commit c33c5e7
Show file tree
Hide file tree
Showing 28 changed files with 885 additions and 40 deletions.
173 changes: 173 additions & 0 deletions .github/workflows/build_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Build Release

on:
push:
branches:
- main
paths:
- "lib/**"
- "video_player/lib/**"

jobs:
build_android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup the Java environment
uses: actions/setup-java@v4
with:
distribution: oracle
java-version: "17"

- name: Setup the flutter environment
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Add signing config
env:
ANDROID_KEY: ${{ secrets.ANDROID_KEY_BASE64 }},
run: |
echo $ANDROID_KEY | base64 -d > android/key.jks
- name: Create key.properties
run: |
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
echo "storeFile=keystore.jks" >> android/key.properties
- name: Build appbundle
run: |
flutter pub get
flutter build appbundle
- name: Rename bundle
run: mv build/app/outputs/bundle/release/app-release.aab build/app/outputs/bundle/release/AlbumShare-{{github.ref_name}}-android.aab

- name: Create symbols archive
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: AlbumShare-{{github.ref_name}}-android-symbols.zip
directory: build/app/intermediates/merged_natove_libs/release/out/lib/

- name: Add files to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
build/app/intermediates/merged_natove_libs/release/out/lib/AlbumShare-{{github.ref_name}}-android-symbols.zip
build/app/outputs/bundle/release/AlbumShare-{{github.ref_name}}-android.aab
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install flutter dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5

- name: Setup the flutter environment
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install project dependencies
run: flutter pub get

- name: Generate build files
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
run: flutter build linux --release

- name: Creative archive
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: AlbumShare-{{github.ref_name}}-linux.zip
directory: build/linux/x64/release/bundle

- name: Add archive to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/linux/x64/release/bundle/AlbumShare-{{github.ref_name}}-linux.zip

build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Setup the flutter environment
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install project dependencies
run: flutter pub get

- name: Generate build files
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
run: flutter build linux --release

- name: Creative archive
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: AlbumShare-{{github.ref_name}}-windows.zip
directory: build/windows/x64/runner/Release

- name: Add archive to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/windows/x64/runner/Release/AlbumShare-{{github.ref_name}}-windows.zip

build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Setup the flutter environment
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install project dependencies
run: flutter pub get

- name: Generate build files
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
run: flutter build macos --release

- name: Creative archive
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: AlbumShare-{{github.ref_name}}-macos.zip
directory: build/macos/Build/Products/Release

- name: Add archive to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/macos/Build/Products/Release/AlbumShare-{{github.ref_name}}-macos.zip

# build_ios:
# runs-on: macos-latest
# steps:
26 changes: 26 additions & 0 deletions .github/workflows/create-version-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Update version tag after merge into 'Deployment'

on:
push:
branches:
- main

jobs:
update-version-tag:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Parse pubspec.yaml
id: yaml-version
uses: pietrobolcato/[email protected]
with:
config: pubspec.yaml

- name: Create release
uses: ncipollo/release-action@v1
with:
tag: "v${{ steps.yaml-version.outputs['version'] }}"
commit: "master"
token: ${{ secrets.GITHUB_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/version-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Verify version & release notes have been updated

on:
push:

jobs:
verify-version:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Ensure pubspec and release notes have been updated"
uses: danieljimeneznz/[email protected]
with:
require-changes-to: |
pubspec.yaml
CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}

- name: List files
id: list-files
run: ls -lah

- name: Parse pubspec.yaml
id: yaml-version
uses: pietrobolcato/[email protected]
with:
config: pubspec.yaml

- name: Print pubspec.yaml version
run: |
echo "${{ steps.yaml-version.outputs['version'] }}"
- name: Fetch previous tag
id: tag-version
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: Display tag version
run: |
echo "${{ steps.tag-version.outputs.tag }}"
- name: "Setup Dart environment"
uses: dart-lang/setup-dart@v1

- name: Install Dart dependencies
run: |
cd version_check
dart pub get
- name: Compare versions
run: dart run version_check/bin/version_check.dart -p "${{ steps.tag-version.outputs.tag }}" -n "${{ steps.yaml-version.outputs.data }}"
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.1] - UNRELEASED

### Added

- Changelog
- Added album title to AssetViewerScreen

### Changed

- Use same colour on material navigation bars and material app bar.
- Updated default preferences.

### Fixed
- Tapping on desktop app bar causes it to hide.
- AssetViewerPage popping when image zoomed.
Now, when the user attempts to navigate back, the image scale is first reset then the page popped if the user attempts to navigate back a second time
- If the user attempts to navigate backwards after logging in, the user is taken to the login page again but remains logged in.
- Pop called twice when asset swiped down.


[0.2.1]: https://github.com/ConcenTech/album_share/compare/main...0.2.1
1 change: 0 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.concentech.album_share"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
Expand Down
8 changes: 1 addition & 7 deletions lib/core/components/app_window/desktop_window_titlebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../../../services/logger/app_logger.dart';
import '../logo_widget.dart';
import 'app_window.dart';

Expand Down Expand Up @@ -82,12 +81,7 @@ class DesktopWindowTitlebar extends StatelessWidget {
...titleBarIcons,
MinimizeWindowButton(),
MaximizeWindowButton(),
CloseWindowButton(
onPressed: () async {
AppLogger.instance.flush();
appWindow.close();
},
),
CloseWindowButton(),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ class MaterialBottomNavigationBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return MediaQuery(
data: MediaQuery.of(context).removePadding(removeTop: true),
child: NavigationBar(
backgroundColor:
(theme.appBarTheme.backgroundColor ?? theme.colorScheme.surface)
.withOpacity(0.6),
selectedIndex: index,
onDestinationSelected: onDestinationSelected,
destinations: items.mapList(
Expand Down Expand Up @@ -50,7 +54,11 @@ class MaterialSideNavigationBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return NavigationRail(
backgroundColor:
(theme.appBarTheme.backgroundColor ?? theme.colorScheme.surface)
.withOpacity(0.6),
selectedIndex: index,
onDestinationSelected: onDestinationSelected,
destinations: items.mapList(
Expand Down
2 changes: 1 addition & 1 deletion lib/core/components/scaffold/desktop_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DesktopScaffold extends ConsumerWidget {
top: appBarVisible ? 0 : -_appBarHeight,
child: MouseRegion(
hitTestBehavior: HitTestBehavior.translucent,
opaque: false,
opaque: true,
child: SizedBox(
height: _appBarHeight,
child: DesktopWindowTitlebar(
Expand Down
26 changes: 22 additions & 4 deletions lib/core/main/app_lifecycle_scope.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// ignore_for_file: avoid_print
// Logging framework likely not initialised at this point.

import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/scheduler.dart';
import 'package:logging/logging.dart';
Expand Down Expand Up @@ -26,10 +31,16 @@ class _AppLifecycleScopeState extends State<AppLifecycleScope>
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.detached) {
AppLogger.instance.flush();
_onClose();
}
}

@override
Future<AppExitResponse> didRequestAppExit() {
_onClose();
return super.didRequestAppExit();
}

@override
void initState() {
super.initState();
Expand All @@ -46,9 +57,16 @@ class _AppLifecycleScopeState extends State<AppLifecycleScope>
void initWindow() {
final locale = AppLocalizations.of(context)!;
AppLocale.instance.set(locale);
AppWindow.setWindow(locale.appTitle)
.then((_) => logger.info('App window set'))
.onError((e, s) => logger.severe('Failed to set window', e, s));
AppWindow.setWindow(locale.appTitle).then((_) {
logger.info('App window set');
}).onError((e, s) {
print('Failed to set window: \n$e, \n$s');
logger.severe('Failed to set window', e, s);
});
}

void _onClose() {
AppLogger.instance.flush();
}

@override
Expand Down
Loading

0 comments on commit c33c5e7

Please sign in to comment.