diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml new file mode 100644 index 0000000..b1fca1b --- /dev/null +++ b/.github/workflows/pr_check.yml @@ -0,0 +1,11 @@ +name: PR Check + +on: + workflow_dispatch: + pull_request: + +jobs: + test: + name: Test + uses: ./.github/workflows/test.yml + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..053bd2b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release to pub.dev + +on: + workflow_dispatch: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' + +jobs: + test: + name: Test + uses: ./.github/workflows/test.yml + secrets: inherit + + publish: + needs: [test] + name: Publish + permissions: + id-token: write # This is required for authentication using OIDC + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v3 + + - uses: dart-lang/setup-dart@v1 + + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + + - name: Install dependencies + run: dart pub get + + - name: code format + run: dart format lib/*/*.dart lib/*.dart + + - name: Publish + run: dart pub publish --force diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ab11363 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: Test + +on: + workflow_call: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1 + with: + channel: 'stable' + + - name: Install packages dependencies + run: flutter pub get + + - name: Analyze the project's Dart code + run: flutter analyze + + - name: Run tests + run: flutter test + + - name: Run tests coverage + run: flutter test --coverage \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 10fd070..c12409e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - `TestsAssetLoader` - `XmlAssetLoader` - `YamlAssetLoader` +- Fixed deprecations ## 0.0.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4570e50 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,11 @@ +# Contributing + +## Release process + + 1. Make sure that the changelog is updated + + 2. Make sure that the version in pubspec.yaml is correct + + 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 + + 4. A pipeline will run and deploy the new version to pub.dev diff --git a/lib/src/http_asset_loader.dart b/lib/src/http_asset_loader.dart index 1687294..56a37f0 100644 --- a/lib/src/http_asset_loader.dart +++ b/lib/src/http_asset_loader.dart @@ -18,7 +18,7 @@ class HttpAssetLoader extends AssetLoader { .then((response) => json.decode(response.body.toString())); } catch (e) { //Catch network exceptions - return Future.value(); + return {}; } } } diff --git a/lib/src/xml_asset_loader.dart b/lib/src/xml_asset_loader.dart index 15f9279..a30a148 100644 --- a/lib/src/xml_asset_loader.dart +++ b/lib/src/xml_asset_loader.dart @@ -51,7 +51,7 @@ Map convertXmlNodeToMap(XmlNode xmlNode) { if (entry is XmlElement) { switch (entry.children.length) { case 1: - map[entry.name.toString()] = entry.text; + map[entry.name.toString()] = entry.value; break; case 0: print(entry.name.toString());