Skip to content

Commit edb9c5c

Browse files
authored
Add Release pipeline
Add Release pipeline
2 parents efca208 + eaa2da1 commit edb9c5c

File tree

7 files changed

+93
-2
lines changed

7 files changed

+93
-2
lines changed

.github/workflows/pr_check.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: PR Check
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
name: Test
10+
uses: ./.github/workflows/test.yml
11+
secrets: inherit

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release to pub.dev
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v[0-9]+.[0-9]+.[0-9]+*'
8+
9+
jobs:
10+
test:
11+
name: Test
12+
uses: ./.github/workflows/test.yml
13+
secrets: inherit
14+
15+
publish:
16+
needs: [test]
17+
name: Publish
18+
permissions:
19+
id-token: write # This is required for authentication using OIDC
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 5
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- uses: dart-lang/setup-dart@v1
27+
28+
- uses: subosito/flutter-action@v2
29+
with:
30+
channel: "stable"
31+
32+
- name: Install dependencies
33+
run: dart pub get
34+
35+
- name: code format
36+
run: dart format lib/*/*.dart lib/*.dart
37+
38+
- name: Publish
39+
run: dart pub publish --force

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-java@v1
13+
with:
14+
java-version: '12.x'
15+
- uses: subosito/flutter-action@v1
16+
with:
17+
channel: 'stable'
18+
19+
- name: Install packages dependencies
20+
run: flutter pub get
21+
22+
- name: Analyze the project's Dart code
23+
run: flutter analyze
24+
25+
- name: Run tests
26+
run: flutter test
27+
28+
- name: Run tests coverage
29+
run: flutter test --coverage

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- `TestsAssetLoader`
1212
- `XmlAssetLoader`
1313
- `YamlAssetLoader`
14+
- Fixed deprecations
1415

1516
## 0.0.1
1617

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributing
2+
3+
## Release process
4+
5+
1. Make sure that the changelog is updated
6+
7+
2. Make sure that the version in pubspec.yaml is correct
8+
9+
3. Create a release in the github UI. Name the release like the version, but with a v (3.7.5 -> v3.7.5). Name the tag like the release
10+
11+
4. A pipeline will run and deploy the new version to pub.dev

lib/src/http_asset_loader.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class HttpAssetLoader extends AssetLoader {
1818
.then((response) => json.decode(response.body.toString()));
1919
} catch (e) {
2020
//Catch network exceptions
21-
return Future.value();
21+
return {};
2222
}
2323
}
2424
}

lib/src/xml_asset_loader.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Map<String, dynamic> convertXmlNodeToMap(XmlNode xmlNode) {
5151
if (entry is XmlElement) {
5252
switch (entry.children.length) {
5353
case 1:
54-
map[entry.name.toString()] = entry.text;
54+
map[entry.name.toString()] = entry.value;
5555
break;
5656
case 0:
5757
print(entry.name.toString());

0 commit comments

Comments
 (0)