From d9d65b63cc136bc620e3950a991ab2fe8abe6e9b Mon Sep 17 00:00:00 2001 From: Albert Wolszon Date: Mon, 20 Feb 2023 11:23:17 +0100 Subject: [PATCH] Use pub.dev automated publishing (#9) * Use automated publishing in CD * Fix build badge * Fix analyzer issues * Use mobile-tools/pub-release action * Add contents permission to CD --- .github/workflows/publish.yml | 19 ++++++++----------- README.md | 4 ++-- lib/src/print_strategy.dart | 3 +-- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ef21a20..48ad9b0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,21 +10,18 @@ jobs: runs-on: ubuntu-latest + permissions: + id-token: write + contents: write + steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Dart uses: dart-lang/setup-dart@v1 with: - sdk: 2.12.0 - - - name: Download pub.dev credentials - env: - CREDENTIALS: ${{ secrets.PUB_DEV_CREDENTIALS }} - run: | - mkdir -p ~/.pub-cache - echo $CREDENTIALS > ~/.pub-cache/credentials.json + sdk: 2.18.6 - - name: Publish - run: dart pub publish -f + - name: Publish and release + uses: leancodepl/mobile-tools/.github/actions/pub-release@pub-release-v1 diff --git a/README.md b/README.md index a64e722..40ca5dc 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,6 @@ class FooBarCubit { [pub-badge]: https://img.shields.io/pub/v/logging_bugfender [pub-badge-link]: https://pub.dev/packages/logging_bugfender -[build-badge]: https://img.shields.io/github/workflow/status/leancodepl/logging_bugfender/test -[build-badge-link]: https://github.com/leancodepl/logging_bugfender/actions?query=workflow%3A%22test%22 +[build-badge]: https://img.shields.io/github/actions/workflow/status/leancodepl/logging_bugfender/test.yml?branch=master +[build-badge-link]: https://github.com/leancodepl/logging_bugfender/actions/workflows/test.yml [logging]: https://pub.dev/packages/logging diff --git a/lib/src/print_strategy.dart b/lib/src/print_strategy.dart index f558948..3dc8b14 100644 --- a/lib/src/print_strategy.dart +++ b/lib/src/print_strategy.dart @@ -1,6 +1,5 @@ import 'package:logging/logging.dart'; - -import 'logging_bugfender.dart'; +import 'package:logging_bugfender/src/logging_bugfender.dart'; /// Defines how [LoggingBugfenderListener] prints log messages. abstract class PrintStrategy {