Compare commits
7 Commits
99a8aaa409
...
v0.1.24
| Author | SHA1 | Date | |
|---|---|---|---|
| dca8c64555 | |||
| c80606b7d0 | |||
| be6020d6c5 | |||
| 5eb58d7cf2 | |||
| 306a38a36a | |||
| 1aaea5f6d9 | |||
| 3a54a077f3 |
@@ -9,76 +9,15 @@ on:
|
|||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
actions: read
|
actions: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
calculate-version:
|
|
||||||
name: Calculate Version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
new_version: ${{ steps.version.outputs.new_version }}
|
|
||||||
bump_type: ${{ steps.version.outputs.bump_type }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Get commit message and determine version bump
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
COMMIT_MSG=$(git log -1 --pretty=%B)
|
|
||||||
HEAD_REF="${{ github.head_ref }}"
|
|
||||||
echo "DEBUG: Commit message: '$COMMIT_MSG'"
|
|
||||||
echo "DEBUG: Head ref: '$HEAD_REF'"
|
|
||||||
|
|
||||||
if [[ $COMMIT_MSG == [fix]* ]]; then
|
|
||||||
BUMP_TYPE="patch"
|
|
||||||
elif [[ $COMMIT_MSG == [feature]* ]]; then
|
|
||||||
BUMP_TYPE="minor"
|
|
||||||
elif [[ $COMMIT_MSG == [release]* ]]; then
|
|
||||||
BUMP_TYPE="major"
|
|
||||||
elif [[ $HEAD_REF == fix/* ]]; then
|
|
||||||
BUMP_TYPE="patch"
|
|
||||||
elif [[ $HEAD_REF == feature/* ]] || [[ $HEAD_REF == feat/* ]]; then
|
|
||||||
BUMP_TYPE="minor"
|
|
||||||
elif [[ $HEAD_REF == release/* ]] || [[ $HEAD_REF == hotfix/* ]]; then
|
|
||||||
BUMP_TYPE="major"
|
|
||||||
else
|
|
||||||
BUMP_TYPE="none"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
|
||||||
LATEST_TAG=${LATEST_TAG#v}
|
|
||||||
|
|
||||||
IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST_TAG"
|
|
||||||
MAJOR=${MAJOR:-0}
|
|
||||||
MINOR=${MINOR:-0}
|
|
||||||
PATCH=${PATCH:-0}
|
|
||||||
|
|
||||||
if [ "$BUMP_TYPE" == "major" ]; then
|
|
||||||
((MAJOR++))
|
|
||||||
MINOR=0
|
|
||||||
PATCH=0
|
|
||||||
elif [ "$BUMP_TYPE" == "minor" ]; then
|
|
||||||
((MINOR++))
|
|
||||||
PATCH=0
|
|
||||||
elif [ "$BUMP_TYPE" == "patch" ]; then
|
|
||||||
((PATCH++))
|
|
||||||
fi
|
|
||||||
|
|
||||||
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
|
|
||||||
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
||||||
echo "bump_type=$BUMP_TYPE" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
build_apk:
|
build_apk:
|
||||||
name: Build Flutter APK
|
name: Build Flutter APK
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: calculate-version
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -99,18 +38,12 @@ jobs:
|
|||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: stable
|
channel: stable
|
||||||
|
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
- run: flutter doctor
|
- run: flutter doctor
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
- name: Update pubspec.yaml with new version
|
|
||||||
run: |
|
|
||||||
sed -i "s/^version: .*/version: ${{ needs.calculate-version.outputs.new_version }}+${{ github.run_number }}/" pubspec.yaml
|
|
||||||
cat pubspec.yaml | grep version
|
|
||||||
|
|
||||||
- name: Build APK
|
- name: Build APK
|
||||||
run: flutter build apk --release
|
run: flutter build apk --release
|
||||||
|
|
||||||
@@ -121,37 +54,14 @@ jobs:
|
|||||||
path: build/app/outputs/flutter-apk/app-release.apk
|
path: build/app/outputs/flutter-apk/app-release.apk
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
create-release:
|
|
||||||
name: Create Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [calculate-version, build_apk]
|
|
||||||
if: needs.calculate-version.outputs.bump_type != 'none'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Download APK artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: flutter-apk
|
|
||||||
|
|
||||||
- name: Create Git tag
|
|
||||||
run: |
|
|
||||||
NEW_TAG="v${{ needs.calculate-version.outputs.new_version }}"
|
|
||||||
git config --local user.name "GitHub Actions"
|
|
||||||
git config --local user.email "actions@github.com"
|
|
||||||
git tag -a "$NEW_TAG" -m "Release ${{ needs.calculate-version.outputs.new_version }}"
|
|
||||||
git push origin "$NEW_TAG"
|
|
||||||
|
|
||||||
- name: Create Gitea release
|
- name: Create Gitea release
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.RUNNER_CREATE_RELEASE }}
|
GITEA_TOKEN: ${{ secrets.RUNNER_CREATE_RELEASE }}
|
||||||
with:
|
with:
|
||||||
tag_name: "v${{ needs.calculate-version.outputs.new_version }}"
|
tag_name: "v0.1.${{ github.run_number }}"
|
||||||
name: "Flutter Android v${{ needs.calculate-version.outputs.new_version }}"
|
name: "Flutter Android v0.1.${{ github.run_number }}"
|
||||||
body: "Automated build from CI\n\nVersion bump type: ${{ needs.calculate-version.outputs.bump_type }}"
|
body: "Automated build from CI"
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
@@ -102,10 +102,16 @@ class _CollectionPageState extends State<CollectionPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: ListView.builder(
|
body: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: ListView.separated(
|
||||||
itemBuilder: (context, index) =>
|
itemBuilder: (context, index) =>
|
||||||
bookmarksListItemBuilder(context, bookmarks.elementAt(index)),
|
bookmarksListItemBuilder(context, bookmarks.elementAt(index)),
|
||||||
itemCount: bookmarks.length,
|
itemCount: bookmarks.length,
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: onAddButtonPressed,
|
onPressed: onAddButtonPressed,
|
||||||
|
|||||||
@@ -110,12 +110,18 @@ class _CollectionsListPageState extends State<CollectionsListPage> {
|
|||||||
child: Icon(Icons.add),
|
child: Icon(Icons.add),
|
||||||
),
|
),
|
||||||
body: collections.isNotEmpty
|
body: collections.isNotEmpty
|
||||||
? ListView.builder(
|
? Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: ListView.separated(
|
||||||
itemBuilder: (context, index) => collectionsListItemBuilder(
|
itemBuilder: (context, index) => collectionsListItemBuilder(
|
||||||
context,
|
context,
|
||||||
collections.elementAt(index),
|
collections.elementAt(index),
|
||||||
),
|
),
|
||||||
itemCount: collections.length,
|
itemCount: collections.length,
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: Center(
|
: Center(
|
||||||
child: Text(AppLocalizations.of(context)!.tipCreateCollections),
|
child: Text(AppLocalizations.of(context)!.tipCreateCollections),
|
||||||
|
|||||||
@@ -14,15 +14,22 @@ class SearchPage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(AppLocalizations.of(context)!.search)),
|
appBar: AppBar(title: Text(AppLocalizations.of(context)!.search)),
|
||||||
body: Column(
|
body: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
Padding(padding: EdgeInsetsGeometry.only(top: 10)),
|
||||||
SearchBarWidget(
|
SearchBarWidget(
|
||||||
onEditingComplete: context.read<SearchProvider>().setSearchText,
|
onEditingComplete: context.read<SearchProvider>().setSearchText,
|
||||||
onResetSearch: context.read<SearchProvider>().removeSearchText,
|
onResetSearch: context.read<SearchProvider>().removeSearchText,
|
||||||
),
|
),
|
||||||
|
Padding(padding: EdgeInsetsGeometry.only(top: 10)),
|
||||||
Expanded(child: SearchResultsWidget()),
|
Expanded(child: SearchResultsWidget()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,26 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
ThemeData get lightTheme => ThemeData.from(colorScheme: _lightColorScheme);
|
const _seed = Colors.deepPurple;
|
||||||
|
|
||||||
ThemeData get darkTheme => ThemeData.from(colorScheme: _darkColorScheme);
|
ColorScheme get _lightColorScheme =>
|
||||||
|
ColorScheme.fromSeed(seedColor: _seed, brightness: Brightness.light);
|
||||||
|
|
||||||
ColorScheme get _darkColorScheme => ColorScheme.fromSeed(
|
ColorScheme get _darkColorScheme =>
|
||||||
seedColor: Colors.deepPurple,
|
ColorScheme.fromSeed(seedColor: _seed, brightness: Brightness.dark);
|
||||||
brightness: Brightness.dark,
|
|
||||||
);
|
ThemeData get lightTheme => _baseTheme(_lightColorScheme);
|
||||||
|
|
||||||
ColorScheme get _lightColorScheme => ColorScheme.fromSeed(
|
ThemeData get darkTheme => _baseTheme(_darkColorScheme);
|
||||||
seedColor: Colors.deepPurple,
|
|
||||||
brightness: Brightness.light,
|
ThemeData _baseTheme(ColorScheme scheme) =>
|
||||||
|
ThemeData.from(colorScheme: scheme, useMaterial3: true).copyWith(
|
||||||
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
),
|
||||||
|
listTileTheme: ListTileThemeData(
|
||||||
|
tileColor: scheme.surfaceContainer,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadiusGeometry.circular(12),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ class CreateBookmarkCollectionDialog extends StatelessWidget {
|
|||||||
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
// TODO: Localize
|
|
||||||
labelText: AppLocalizations.of(context)!.collectionName,
|
labelText: AppLocalizations.of(context)!.collectionName,
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
@@ -61,9 +61,6 @@ class CreateBookmarkDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context)!.bookmarkTitle,
|
labelText: AppLocalizations.of(context)!.bookmarkTitle,
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
@@ -78,9 +75,6 @@ class CreateBookmarkDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context)!.url,
|
labelText: AppLocalizations.of(context)!.url,
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
@@ -95,9 +89,6 @@ class CreateBookmarkDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context)!.description,
|
labelText: AppLocalizations.of(context)!.description,
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
class SearchBarWidget extends StatelessWidget {
|
class SearchBarWidget extends StatelessWidget {
|
||||||
const SearchBarWidget({
|
const SearchBarWidget({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -28,6 +30,7 @@ class SearchBarWidget extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
icon: Icon(Icons.delete_outline_outlined),
|
icon: Icon(Icons.delete_outline_outlined),
|
||||||
),
|
),
|
||||||
|
labelText: AppLocalizations.of(context)!.search,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ class _SearchResultsWidgetState extends State<SearchResultsWidget> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (filteredBookmarks.isNotEmpty) {
|
if (filteredBookmarks.isNotEmpty) {
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
itemBuilder: bookmarkListItemBuilder,
|
itemBuilder: bookmarkListItemBuilder,
|
||||||
itemCount: filteredBookmarks.length,
|
itemCount: filteredBookmarks.length,
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(child: Text(AppLocalizations.of(context)!.tipNoResults));
|
return Center(child: Text(AppLocalizations.of(context)!.tipNoResults));
|
||||||
|
|||||||
Reference in New Issue
Block a user