Skip to content

Commit 1fb0298

Browse files
committed
update
1 parent 9d07149 commit 1fb0298

File tree

6 files changed

+87
-13
lines changed

6 files changed

+87
-13
lines changed

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/.DS_Store

.github/scripts/update_changelog.dart

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ void main(List<String> args) {
4040
),
4141
);
4242
}
43-
contents =
44-
'# Changelog\n\n${(sections.toList()..sort((a, b) {
45-
return compareVersions(b.version, a.version);
46-
})).map((e) => e.toString()).join('\n')}';
43+
contents = '# Changelog\n\n${(sections.toList()..sort((a, b) {
44+
return compareVersions(b.version, a.version);
45+
})).map((e) => e.toString()).join('\n')}';
4746

4847
file.writeAsStringSync(contents);
4948
print('Changelog updated with version $version.');
@@ -60,9 +59,8 @@ Set<_VersionSection> extractSections(String contents) {
6059
final end = i + 1 < allVersionMatches.length ? allVersionMatches[i + 1].start : contents.length;
6160
final sectionContents = contents.substring(start, end).trim();
6261
final lines = sectionContents.split('\n').where((line) => line.isNotEmpty).toList();
63-
final version = allVersionMatches[i]
64-
.group(0)!
65-
.substring(4, allVersionMatches[i].group(0)!.length - 1);
62+
final version =
63+
allVersionMatches[i].group(0)!.substring(4, allVersionMatches[i].group(0)!.length - 1);
6664
var releasedAt = DateTime.now().toUtc();
6765
final updates = <String>{};
6866
final old = lines
@@ -78,7 +76,11 @@ Set<_VersionSection> extractSections(String contents) {
7876
updates.add(line);
7977
}
8078
}
81-
results.add(_VersionSection(version: version, releasedAt: releasedAt, updates: updates));
79+
results.add(_VersionSection(
80+
version: version,
81+
releasedAt: releasedAt,
82+
updates: updates,
83+
));
8284
}
8385

8486
return results;
@@ -99,8 +101,11 @@ class _VersionSection {
99101
//
100102
//
101103

102-
_VersionSection({required this.version, required this.releasedAt, Set<String>? updates})
103-
: this.updates = updates ?? {};
104+
_VersionSection({
105+
required this.version,
106+
required this.releasedAt,
107+
Set<String>? updates,
108+
}) : this.updates = updates ?? {};
104109

105110
//
106111
//
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
##.title
2+
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3+
##
4+
## Dart/Flutter (DF) Packages by dev-cetera.com & contributors. The use of this
5+
## source code is governed by an MIT-style license described in the LICENSE
6+
## file located in this project's root directory.
7+
##
8+
## See: https://opensource.org/license/mit
9+
##
10+
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
11+
##.title~
12+
13+
name: Deploy hosted_example to GitHub Pages
14+
15+
## -----------------------------------------------------------------------------
16+
17+
on:
18+
push:
19+
branches:
20+
- main
21+
22+
## -----------------------------------------------------------------------------
23+
24+
jobs:
25+
build-and-deploy:
26+
runs-on: ubuntu-latest
27+
steps:
28+
# Checkout the code from the repository
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
# Set up Flutter
33+
- name: Set up Flutter
34+
uses: subosito/flutter-action@v2
35+
with:
36+
channel: "stable"
37+
flutter-version: "3.x"
38+
39+
# Install all project dependencies
40+
- name: Install dependencies
41+
run: flutter pub get
42+
working-directory: ./hosted_example
43+
44+
# Enable Flutter web support
45+
- name: Enable Flutter web support
46+
run: flutter config --enable-web
47+
working-directory: ./hosted_example
48+
49+
# Build the web app in /hosted_example/
50+
- name: Build web app in /hosted_example/
51+
run: flutter build web --release --base-href "/${{ github.event.repository.name }}/"
52+
working-directory: ./hosted_example
53+
54+
# Necessary
55+
- name: Create .nojekyll
56+
run: touch hosted_example/build/web/.nojekyll
57+
58+
# Necessary
59+
- name: Create 404.html for SPA routing
60+
run: cp hosted_example/build/web/index.html hosted_example/build/web/404.html
61+
62+
# Deploy the app to GitHub Pages
63+
- name: Deploy to GitHub Pages
64+
uses: peaceiris/actions-gh-pages@v4
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
publish_dir: ./hosted_example/build/web
68+
keep_files: false

.github/workflows/prepare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ jobs:
9191
git config user.email github-actions@github.com
9292
git add .
9393
git commit -m "Prepare version ${{ steps.get_version.outputs.PUBSPEC_VERSION }}"
94-
git push
94+
git push

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
publish:
2626
permissions:
2727
id-token: write
28-
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
28+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
name: df_generate_dart_models_core
1414
description: A package that provides core dependencies for models generated with df_generate_dart_models.
15-
version: 0.9.14
15+
version: 0.9.15
1616
homepage: https://dev-cetera.com
1717
repository: https://github.com/dev-cetera/df_generate_dart_models_core
1818
funding:

0 commit comments

Comments
 (0)