Skip to content

Commit 85a0195

Browse files
authored
Update workflows and dependencies for version 7.5.8 (#111)
- Upgrade `google_fonts` dependency to `^8.0.0` - Add prechecks job to validate tag format and main branch commit - Create checks workflow for pull requests - Update main.dart to use 'Ubuntu Mono' font - Adjust version in pubspec.yaml and pubspec.lock
2 parents 86bf059 + c443d6b commit 85a0195

8 files changed

Lines changed: 135 additions & 77 deletions

File tree

.fvmrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/checks.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Checks"
2+
3+
on:
4+
pull_request:
5+
branches: [ main, next, development ]
6+
types: [ opened, synchronize, reopened ]
7+
8+
jobs:
9+
lint-dart:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v6
15+
16+
- name: Setup Flutter
17+
uses: flutter-actions/setup-flutter@v4
18+
with:
19+
channel: stable
20+
version: 3.38.8
21+
cache-sdk: true
22+
cache: true
23+
24+
- name: Install dependencies
25+
run: flutter pub get
26+
27+
- name: Run checks
28+
run: flutter analyze

.github/workflows/publish.yaml

Lines changed: 93 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,80 +4,126 @@ on:
44
push:
55
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
7-
- 'v[0-9]+.[0-9]+.[0-9]+-dev[0-9]+'
8-
- 'v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+'
9-
- 'v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+'
10-
- 'v[0-9]+.[0-9]+.[0-9]+-prerelease[0-9]+'
11-
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
12-
13-
permissions:
14-
contents: read
15-
pages: write
16-
id-token: write
17-
repository-projects: read
18-
packages: read
197

208
jobs:
21-
publish:
9+
prechecks:
2210
runs-on: ubuntu-latest
23-
container:
24-
image: ghcr.io/goldenm-software/flutter-web-builder:flutter3.38.3-uv-python3.13
25-
options: --user root
26-
credentials:
27-
username: ${{ github.repository_owner }}
28-
password: ${{ secrets.GITHUB_TOKEN }}
29-
30-
env:
31-
PUB_JSON: ${{ secrets.LAYRZ_PUB_TOKEN }}
3211

3312
steps:
3413
- name: Checkout
35-
uses: actions/checkout@v4
36-
37-
- name: Get tag version
38-
run: |
39-
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
40-
41-
- name: Authenticate
14+
uses: actions/checkout@v6
15+
- name: Check tag format
4216
run: |
43-
python3 authenticate.py
17+
if [[ ! "${GITHUB_REF#refs/tags/}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
18+
echo "Tag name does not match semantic versioning format vX.Y.Z"
19+
exit 1
20+
fi
4421
45-
- name: Publish
22+
- name: Check main branch
4623
run: |
47-
flutter pub publish --force
48-
49-
- name: Cleanup
24+
LATEST_COMMIT=$(git rev-parse HEAD)
25+
MAIN_COMMIT=$(git rev-parse origin/main)
26+
if [ "$LATEST_COMMIT" != "$MAIN_COMMIT" ]; then
27+
echo "The tag must be created from the latest commit on the main branch."
28+
exit 1
29+
fi
30+
31+
deploy-dart:
32+
needs: prechecks
33+
runs-on: ubuntu-latest
34+
35+
permissions:
36+
id-token: write
37+
contents: write
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v6
42+
43+
44+
- name: Setup Flutter
45+
uses: flutter-actions/setup-flutter@v4
46+
with:
47+
channel: stable
48+
version: 3.38.8
49+
cache: true
50+
cache-sdk: true
51+
52+
- name: Install dependencies
53+
run: flutter pub get
54+
55+
- name: Run checks
56+
run: flutter analyze
57+
58+
- name: Dry run
59+
run: flutter pub publish --dry-run
60+
61+
- name: Publish to pub.dev
62+
uses: dart-lang/setup-dart@v1
63+
with:
64+
sdk: stable
65+
66+
- name: Publish to pub.dev
67+
run: flutter pub publish --force
68+
69+
- name: Rename tag when fails
70+
if: failure()
5071
run: |
51-
dart pub token remove https://pub.dev
72+
git config --global user.name "github-actions[bot]"
73+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
74+
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
75+
TAG_NAME=${GITHUB_REF#refs/tags/}
76+
NEW_TAG="failed-${TAG_NAME}-${TIMESTAMP}"
77+
git tag $NEW_TAG
78+
git push origin $NEW_TAG
79+
git push --delete origin $TAG_NAME
5280
53-
buils-site:
81+
- name: Create GitHub Release
82+
if: success()
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
tag_name: ${{ github.ref_name }}
86+
name: Release ${{ github.ref_name }}
87+
draft: false
88+
prerelease: false
89+
generate_release_notes: true
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
93+
build-site:
5494
runs-on: ubuntu-latest
55-
container:
56-
image: ghcr.io/goldenm-software/flutter-web-builder:flutter3.38.3-uv-python3.13
57-
options: --user root
58-
credentials:
59-
username: ${{ github.repository_owner }}
60-
password: ${{ secrets.GITHUB_TOKEN }}
95+
needs: deploy-dart
96+
97+
permissions:
98+
pages: write
99+
id-token: write
61100

62101
steps:
63102
- name: Checkout
64-
uses: actions/checkout@v4
103+
uses: actions/checkout@v6
104+
105+
106+
- name: Setup Flutter
107+
uses: flutter-actions/setup-flutter@v4
108+
with:
109+
channel: stable
110+
version: 3.38.8
111+
cache: true
65112

66113
- name: Setup Pages
67114
id: setup_pages
68-
uses: actions/configure-pages@v4.0.0
115+
uses: actions/configure-pages@v5
69116

70117
- name: Build
71118
run: |
72119
cd example
73120
flutter build web --release --base-href=${{ steps.setup_pages.outputs.base_path }}/ --no-tree-shake-icons --wasm
74121
75122
- name: Upload artifact
76-
uses: actions/upload-pages-artifact@v3.0.0
123+
uses: actions/upload-pages-artifact@v4
77124
with:
78-
# Upload entire repository
79125
path: './example/build/web'
80126

81127
- name: Deploy to GitHub Pages
82128
id: deployment
83-
uses: actions/deploy-pages@v4.0.3
129+
uses: actions/deploy-pages@v4

.vscode/launch.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
"name": "VSCode connected device",
66
"cwd": "example",
77
"request": "launch",
8-
"type": "dart",
9-
"toolArgs": [
10-
"--web-experimental-hot-reload"
11-
]
8+
"type": "dart"
129
},
1310
{
1411
"name": "VSCode connected device (Profile)",

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Changelog
22

3+
## 7.5.8
4+
5+
- Upgraded `google_fonts` dependency to `^8.0.0` to support latest font features and improvements.
6+
37
## 7.5.7
8+
49
- Added `focusNode` prop to `ThemedNumberInput` to allow external focus node management.
510

611
## 7.5.6
12+
713
- Add `onLongPress` with `customLongPressDuration` in `ThemedButton`
814

915
## 7.5.5

example/lib/main.dart

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// import 'package:flutter/foundation.dart';
2-
// import 'package:flutter_dotenv/flutter_dotenv.dart';
31
import 'package:collection/collection.dart';
42
import 'package:flutter/material.dart';
53
import 'package:layrz_models/layrz_models.dart';
@@ -9,23 +7,13 @@ import 'package:layrz_theme_example/store/store.dart';
97
import 'package:shared_preferences/shared_preferences.dart';
108
import 'package:layrz_state/layrz_state.dart';
119

12-
const font = AppFont(source: FontSource.google, name: 'Ubuntu');
10+
const font = AppFont(source: .google, name: 'Ubuntu Mono');
11+
1312
Future<void> main() async {
1413
WidgetsFlutterBinding.ensureInitialized();
1514

1615
await ThemedFontHandler.preloadFont(font);
1716

18-
String? mapboxToken;
19-
String? googleToken;
20-
String? hereToken;
21-
22-
// if (kDebugMode) {
23-
// await dotenv.load(fileName: ".env");
24-
// mapboxToken = dotenv.env['MAPBOX_TOKEN'];
25-
// googleToken = dotenv.env['GOOGLE_TOKEN'];
26-
// hereToken = dotenv.env['HERE_TOKEN'];
27-
// }
28-
2917
final prefs = await SharedPreferences.getInstance();
3018
final rawThemeMode = prefs.getString('layrz.theme.mode');
3119
ThemeMode? themeMode;
@@ -44,9 +32,6 @@ Future<void> main() async {
4432
LayrzState(
4533
store: AppStore(
4634
themeMode: themeMode ?? ThemeMode.system,
47-
mapboxToken: mapboxToken,
48-
googleToken: googleToken,
49-
hereToken: hereToken,
5035
colorblindMode: colorblindMode ?? ColorblindMode.normal,
5136
colorblindStrength: colorblindStrength,
5237
),

example/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,10 @@ packages:
276276
dependency: transitive
277277
description:
278278
name: google_fonts
279-
sha256: "517b20870220c48752eafa0ba1a797a092fb22df0d89535fd9991e86ee2cdd9c"
279+
sha256: bf1fe61d4a53420a94cbbd4326e07702d247757926f6955af9667765a8324413
280280
url: "https://pub.dev"
281281
source: hosted
282-
version: "6.3.2"
282+
version: "8.0.0"
283283
highlight:
284284
dependency: transitive
285285
description:
@@ -374,7 +374,7 @@ packages:
374374
path: ".."
375375
relative: true
376376
source: path
377-
version: "7.5.5"
377+
version: "7.5.8"
378378
leak_tracker:
379379
dependency: transitive
380380
description:

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: layrz_theme
22
description: Layrz standard styling library for Flutter. Widget library following the Material Design 3 guidelines, with a focus on reliavility and functionality.
3-
version: "7.5.7"
3+
version: "7.5.8"
44
homepage: https://theme.layrz.com
55
repository: https://github.com/goldenm-software/layrz_theme
66

@@ -20,7 +20,7 @@ dependencies:
2020
sdk: flutter
2121

2222
file: ^7.0.1
23-
google_fonts: ^6.2.1
23+
google_fonts: ^8.0.0
2424
mime: ^2.0.0
2525
flex_color_picker: ^3.7.0
2626
collection: ^1.19.0

0 commit comments

Comments
 (0)