Skip to content

Commit 7e8a606

Browse files
authored
Merge pull request #32 from cedvdb/feat/auto-publish-workflow
Added auto publish workflow
2 parents 57d655b + ea9c68f commit 7e8a606

28 files changed

Lines changed: 145 additions & 34 deletions

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Publish to pub.dev
33
on:
44
push:
55
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+*'
6+
- "v*"
77

88
jobs:
99
publish:
1010
permissions:
1111
id-token: write # Required for authentication using OIDC
12-
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

.github/workflows/tag_creation.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Create Tag from pubspec.yaml
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
create-tag:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # needed to push tags
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Read version from pubspec.yaml
18+
id: version
19+
run: |
20+
VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}')
21+
echo "version=$VERSION" >> $GITHUB_OUTPUT
22+
echo "📦 Detected version: $VERSION"
23+
24+
- name: Fail if tag already exists
25+
run: |
26+
VERSION=v${{ steps.version.outputs.version }}
27+
if git ls-remote --tags origin | grep -q "refs/tags/$VERSION$"; then
28+
echo "❌ Tag $VERSION already exists on remote. Failing workflow."
29+
exit 1
30+
fi
31+
32+
- name: Check if version exists in CHANGELOG.md
33+
run: |
34+
VERSION=${{ steps.version.outputs.version }}
35+
if ! grep -q "##\s*\[$VERSION\]" CHANGELOG.md; then
36+
echo "❌ CHANGELOG.md does not contain an entry for version [$VERSION]"
37+
echo "👉 Please add a changelog entry like: '## [$VERSION]'"
38+
exit 1
39+
fi
40+
echo "✅ Found changelog entry for [$VERSION]"
41+
42+
- name: Create and push tag with gh + PAT
43+
env:
44+
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
45+
VERSION: v${{ steps.version.outputs.version }}
46+
run: |
47+
git config user.name "github-actions[bot]"
48+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
49+
50+
echo "🏷️ Creating tag: $VERSION"
51+
git tag "$VERSION"
52+
53+
echo "⬆️ Pushing tag with gh CLI"
54+
gh api \
55+
--method POST \
56+
-H "Accept: application/vnd.github+json" \
57+
/repos/${GITHUB_REPOSITORY}/git/refs \
58+
-f ref="refs/tags/$VERSION" \
59+
-f sha="$(git rev-parse HEAD)"
60+
61+
echo "✅ Tag $VERSION pushed successfully!"

example/pubspec.lock

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ packages:
2929
dependency: transitive
3030
description:
3131
name: characters
32-
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
32+
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
3333
url: "https://pub.dev"
3434
source: hosted
35-
version: "1.3.0"
35+
version: "1.4.0"
3636
circle_flags:
3737
dependency: transitive
3838
description:
@@ -45,18 +45,18 @@ packages:
4545
dependency: transitive
4646
description:
4747
name: clock
48-
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
48+
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
4949
url: "https://pub.dev"
5050
source: hosted
51-
version: "1.1.1"
51+
version: "1.1.2"
5252
collection:
5353
dependency: transitive
5454
description:
5555
name: collection
56-
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
56+
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
5757
url: "https://pub.dev"
5858
source: hosted
59-
version: "1.19.0"
59+
version: "1.19.1"
6060
cupertino_icons:
6161
dependency: "direct main"
6262
description:
@@ -77,10 +77,10 @@ packages:
7777
dependency: transitive
7878
description:
7979
name: fake_async
80-
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
80+
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
8181
url: "https://pub.dev"
8282
source: hosted
83-
version: "1.3.1"
83+
version: "1.3.3"
8484
flutter:
8585
dependency: "direct main"
8686
description: flutter
@@ -92,7 +92,7 @@ packages:
9292
path: ".."
9393
relative: true
9494
source: path
95-
version: "1.0.12"
95+
version: "1.0.17"
9696
flutter_lints:
9797
dependency: "direct dev"
9898
description:
@@ -139,34 +139,34 @@ packages:
139139
dependency: transitive
140140
description:
141141
name: intl
142-
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
142+
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
143143
url: "https://pub.dev"
144144
source: hosted
145-
version: "0.19.0"
145+
version: "0.20.2"
146146
leak_tracker:
147147
dependency: transitive
148148
description:
149149
name: leak_tracker
150-
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
150+
sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
151151
url: "https://pub.dev"
152152
source: hosted
153-
version: "10.0.8"
153+
version: "11.0.1"
154154
leak_tracker_flutter_testing:
155155
dependency: transitive
156156
description:
157157
name: leak_tracker_flutter_testing
158-
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
158+
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
159159
url: "https://pub.dev"
160160
source: hosted
161-
version: "3.0.9"
161+
version: "3.0.10"
162162
leak_tracker_testing:
163163
dependency: transitive
164164
description:
165165
name: leak_tracker_testing
166-
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
166+
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
167167
url: "https://pub.dev"
168168
source: hosted
169-
version: "3.0.1"
169+
version: "3.0.2"
170170
lints:
171171
dependency: transitive
172172
description:
@@ -179,10 +179,10 @@ packages:
179179
dependency: transitive
180180
description:
181181
name: matcher
182-
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
182+
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
183183
url: "https://pub.dev"
184184
source: hosted
185-
version: "0.12.16+1"
185+
version: "0.12.17"
186186
material_color_utilities:
187187
dependency: transitive
188188
description:
@@ -195,18 +195,18 @@ packages:
195195
dependency: transitive
196196
description:
197197
name: meta
198-
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
198+
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
199199
url: "https://pub.dev"
200200
source: hosted
201-
version: "1.15.0"
201+
version: "1.16.0"
202202
path:
203203
dependency: transitive
204204
description:
205205
name: path
206-
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
206+
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
207207
url: "https://pub.dev"
208208
source: hosted
209-
version: "1.9.0"
209+
version: "1.9.1"
210210
path_parsing:
211211
dependency: transitive
212212
description:
@@ -248,18 +248,18 @@ packages:
248248
dependency: transitive
249249
description:
250250
name: stack_trace
251-
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
251+
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
252252
url: "https://pub.dev"
253253
source: hosted
254-
version: "1.12.0"
254+
version: "1.12.1"
255255
stream_channel:
256256
dependency: transitive
257257
description:
258258
name: stream_channel
259-
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
259+
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
260260
url: "https://pub.dev"
261261
source: hosted
262-
version: "2.1.2"
262+
version: "2.1.4"
263263
string_scanner:
264264
dependency: transitive
265265
description:
@@ -280,10 +280,10 @@ packages:
280280
dependency: transitive
281281
description:
282282
name: test_api
283-
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
283+
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
284284
url: "https://pub.dev"
285285
source: hosted
286-
version: "0.7.3"
286+
version: "0.7.6"
287287
typed_data:
288288
dependency: transitive
289289
description:
@@ -320,10 +320,10 @@ packages:
320320
dependency: transitive
321321
description:
322322
name: vector_math
323-
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
323+
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
324324
url: "https://pub.dev"
325325
source: hosted
326-
version: "2.1.4"
326+
version: "2.2.0"
327327
vm_service:
328328
dependency: transitive
329329
description:
@@ -349,5 +349,5 @@ packages:
349349
source: hosted
350350
version: "6.5.0"
351351
sdks:
352-
dart: ">=3.4.0 <4.0.0"
352+
dart: ">=3.8.0-0 <4.0.0"
353353
flutter: ">=3.18.0-18.0.pre.54"

lib/src/localization/generated/country_selector_localization_ar.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'country_selector_localization.dart';
24

35
// ignore_for_file: type=lint

lib/src/localization/generated/country_selector_localization_ca.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'country_selector_localization.dart';
24

35
// ignore_for_file: type=lint

lib/src/localization/generated/country_selector_localization_ckb.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'country_selector_localization.dart';
24

35
// ignore_for_file: type=lint

lib/src/localization/generated/country_selector_localization_de.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'country_selector_localization.dart';
24

35
// ignore_for_file: type=lint

lib/src/localization/generated/country_selector_localization_el.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'country_selector_localization.dart';
24

35
// ignore_for_file: type=lint

lib/src/localization/generated/country_selector_localization_en.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'country_selector_localization.dart';
24

35
// ignore_for_file: type=lint

lib/src/localization/generated/country_selector_localization_es.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore: unused_import
2+
import 'package:intl/intl.dart' as intl;
13
import 'country_selector_localization.dart';
24

35
// ignore_for_file: type=lint

0 commit comments

Comments
 (0)