Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Deploy package"
Comment thread
PHKenny marked this conversation as resolved.
Outdated

on:
pull_request:
branches: [ main, next, development ]
types: [ opened, synchronize, reopened ]

jobs:
lint-dart:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6
Comment thread
PHKenny marked this conversation as resolved.

- name: Setup Flutter
uses: flutter-actions/setup-flutter@v4
Comment thread
PHKenny marked this conversation as resolved.
with:
channel: stable
version: 3.38.8
cache: true

- name: Install dependencies
run: flutter pub get

- name: Run checks
run: flutter analyze
135 changes: 88 additions & 47 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,121 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-dev[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-prerelease[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'

permissions:
contents: read
pages: write
id-token: write
repository-projects: read
packages: read

jobs:
publish:
prechecks:
runs-on: ubuntu-latest
container:
image: ghcr.io/goldenm-software/flutter-web-builder:flutter3.38.3-uv-python3.13
options: --user root
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

env:
PUB_JSON: ${{ secrets.LAYRZ_PUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get tag version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Authenticate
uses: actions/checkout@v6
Comment thread
PHKenny marked this conversation as resolved.
- name: Check tag format
run: |
python3 authenticate.py
if [[ ! "${GITHUB_REF#refs/tags/}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag name does not match semantic versioning format vX.Y.Z"
exit 1
fi

- name: Publish
- name: Check main branch
run: |
flutter pub publish --force

- name: Cleanup
LATEST_COMMIT=$(git rev-parse HEAD)
MAIN_COMMIT=$(git rev-parse origin/main)
if [ "$LATEST_COMMIT" != "$MAIN_COMMIT" ]; then
echo "The tag must be created from the latest commit on the main branch."
exit 1
fi

deploy-dart:
needs: prechecks
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write

steps:
- name: Checkout
uses: actions/checkout@v6


- name: Setup Flutter
uses: flutter-actions/setup-flutter@v4
with:
channel: stable
version: 3.38.8
cache: true

- name: Install dependencies
run: flutter pub get

- name: Run checks
run: flutter analyze

- name: Dry run
run: flutter pub publish --dry-run

- name: Publish to pub.dev
uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Publish to pub.dev
run: flutter pub publish --force
Comment thread
PHKenny marked this conversation as resolved.

- name: Rename tag when fails
if: failure()
run: |
dart pub token remove https://pub.dev
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
TAG_NAME=${GITHUB_REF#refs/tags/}
NEW_TAG="failed-${TAG_NAME}-${TIMESTAMP}"
git tag $NEW_TAG
git push origin $NEW_TAG
git push --delete origin $TAG_NAME

- name: Create GitHub Release
if: success()
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

buils-site:
build-site:
runs-on: ubuntu-latest
container:
image: ghcr.io/goldenm-software/flutter-web-builder:flutter3.38.3-uv-python3.13
options: --user root
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
needs: deploy-dart

Comment thread
PHKenny marked this conversation as resolved.
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6


- name: Setup Flutter
uses: flutter-actions/setup-flutter@v4
with:
channel: stable
version: 3.38.8
cache: true

- name: Setup Pages
id: setup_pages
uses: actions/configure-pages@v4.0.0
uses: actions/configure-pages@v5

- name: Build
run: |
cd example
flutter build web --release --base-href=${{ steps.setup_pages.outputs.base_path }}/ --no-tree-shake-icons --wasm

- name: Upload artifact
uses: actions/upload-pages-artifact@v3.0.0
uses: actions/upload-pages-artifact@v4
with:
# Upload entire repository
path: './example/build/web'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.3
uses: actions/deploy-pages@v4
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Changelog

## 7.5.8

- Upgraded `google_fonts` dependency to `^8.0.0` to support latest font features and improvements.

## 7.5.7

- Added `focusNode` prop to `ThemedNumberInput` to allow external focus node management.

## 7.5.6

- Add `onLongPress` with `customLongPressDuration` in `ThemedButton`

## 7.5.5
Expand Down
19 changes: 2 additions & 17 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import 'package:flutter/foundation.dart';
// import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:layrz_models/layrz_models.dart';
Expand All @@ -9,23 +7,13 @@ import 'package:layrz_theme_example/store/store.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:layrz_state/layrz_state.dart';

const font = AppFont(source: FontSource.google, name: 'Ubuntu');
const font = AppFont(source: .google, name: 'Ubuntu Mono');

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

await ThemedFontHandler.preloadFont(font);

String? mapboxToken;
String? googleToken;
String? hereToken;

// if (kDebugMode) {
// await dotenv.load(fileName: ".env");
// mapboxToken = dotenv.env['MAPBOX_TOKEN'];
// googleToken = dotenv.env['GOOGLE_TOKEN'];
// hereToken = dotenv.env['HERE_TOKEN'];
// }

final prefs = await SharedPreferences.getInstance();
final rawThemeMode = prefs.getString('layrz.theme.mode');
ThemeMode? themeMode;
Expand All @@ -44,9 +32,6 @@ Future<void> main() async {
LayrzState(
store: AppStore(
themeMode: themeMode ?? ThemeMode.system,
mapboxToken: mapboxToken,
googleToken: googleToken,
hereToken: hereToken,
colorblindMode: colorblindMode ?? ColorblindMode.normal,
colorblindStrength: colorblindStrength,
),
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ packages:
dependency: transitive
description:
name: google_fonts
sha256: "517b20870220c48752eafa0ba1a797a092fb22df0d89535fd9991e86ee2cdd9c"
sha256: bf1fe61d4a53420a94cbbd4326e07702d247757926f6955af9667765a8324413
url: "https://pub.dev"
source: hosted
version: "6.3.2"
version: "8.0.0"
highlight:
dependency: transitive
description:
Expand Down Expand Up @@ -374,7 +374,7 @@ packages:
path: ".."
relative: true
source: path
version: "7.5.5"
version: "7.5.8"
leak_tracker:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: layrz_theme
description: Layrz standard styling library for Flutter. Widget library following the Material Design 3 guidelines, with a focus on reliavility and functionality.
version: "7.5.7"
version: "7.5.8"
homepage: https://theme.layrz.com
repository: https://github.com/goldenm-software/layrz_theme

Expand All @@ -20,7 +20,7 @@ dependencies:
sdk: flutter

file: ^7.0.1
google_fonts: ^6.2.1
google_fonts: ^8.0.0
mime: ^2.0.0
flex_color_picker: ^3.7.0
collection: ^1.19.0
Expand Down