diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 77b052a..c52b050 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -22,16 +22,16 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.2 - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4.5.0 with: distribution: temurin java-version: "17" - name: Flutter action - uses: subosito/flutter-action@v2.8.0 + uses: subosito/flutter-action@v2.16.0 with: channel: stable @@ -39,7 +39,7 @@ jobs: run: flutter --version - name: Cache pubspec dependencies - uses: actions/cache@v3.0.7 + uses: actions/cache@v4.1.2 with: path: | ${{ env.FLUTTER_HOME }}/.pub-cache @@ -52,7 +52,7 @@ jobs: build-pubspec- - name: Cache build runner - uses: actions/cache@v2 + uses: actions/cache@v4.1.2 with: path: | **/.dart_tool diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2763f24..5c139ad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,56 +1,31 @@ name: Publish plugin on: - release: - types: [published] + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' jobs: - publish: + test: runs-on: ubuntu-latest - steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.2 - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4.5.0 with: distribution: temurin java-version: "17" - name: Flutter action - uses: subosito/flutter-action@v2.8.0 + uses: subosito/flutter-action@v2.16.0 with: channel: stable - name: Flutter version run: flutter --version - - name: Cache pubspec dependencies - uses: actions/cache@v3.0.7 - with: - path: | - ${{ env.FLUTTER_HOME }}/.pub-cache - **/.packages - **/.flutter-plugins - **/.flutter-plugin-dependencies - **/.dart_tool/package_config.json - key: build-pubspec-${{ hashFiles('**/pubspec.lock') }} - restore-keys: | - build-pubspec- - - - name: Cache build runner - uses: actions/cache@v2 - with: - path: | - **/.dart_tool - **/*.g.dart - **/*.mocks.dart - **/*.config.dart - key: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} - restore-keys: | - build-runner- - - name: Download pub dependencies run: flutter pub get @@ -60,30 +35,16 @@ jobs: - name: Run analyzer run: flutter analyze --fatal-infos - - name: Install coverage tools - run: flutter pub global activate coverage - - name: Run tests run: flutter test --coverage - - name: Setup Pub Credentials - shell: bash - env: - PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }} - PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }} - PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }} - PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }} - run: | - sh ./pub_login.sh - - name: Check Publish Warnings run: flutter pub publish --dry-run - - name: Publish Package - run: flutter pub publish -f - - - name: Upload Coverage to CodeCov - uses: codecov/codecov-action@v3 - with: - token: ${{secrets.CODECOV_TOKEN}} - file: coverage/lcov.info + publish: + needs: 'test' + permissions: + id-token: write # Required for authentication using OIDC + uses: git-elliot/setup-dart/.github/workflows/publish.yml@main # Added build_runner step + with: + environment: 'pub.dev' \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e7bb17d..16b4d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## 2.0.3 +1. Dependencies updated. + ## 2.0.2 1. Mdns search works on iOS now. diff --git a/pub_login.sh b/pub_login.sh deleted file mode 100644 index 441cffb..0000000 --- a/pub_login.sh +++ /dev/null @@ -1,36 +0,0 @@ -# This script creates/updates credentials.json file which is used -# to authorize publisher when publishing packages to pub.dev - -# Checking whether the secrets are available as environment -# variables or not. -if [ -z "${PUB_DEV_PUBLISH_ACCESS_TOKEN}" ]; then - echo "Missing PUB_DEV_PUBLISH_ACCESS_TOKEN environment variable" - exit 1 -fi - -if [ -z "${PUB_DEV_PUBLISH_REFRESH_TOKEN}" ]; then - echo "Missing PUB_DEV_PUBLISH_REFRESH_TOKEN environment variable" - exit 1 -fi - -if [ -z "${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}" ]; then - echo "Missing PUB_DEV_PUBLISH_TOKEN_ENDPOINT environment variable" - exit 1 -fi - -if [ -z "${PUB_DEV_PUBLISH_EXPIRATION}" ]; then - echo "Missing PUB_DEV_PUBLISH_EXPIRATION environment variable" - exit 1 -fi -mkdir -p $HOME/.config/dart -# Create credentials.json file. -cat < $HOME/.config/dart/pub-credentials.json -{ - "accessToken":"${PUB_DEV_PUBLISH_ACCESS_TOKEN}", - "refreshToken":"${PUB_DEV_PUBLISH_REFRESH_TOKEN}", - "tokenEndpoint":"${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}", - "idToken": "${PUB_DEV_PUBLISH_ID_TOKEN}", - "scopes":["openid","https://www.googleapis.com/auth/userinfo.email"], - "expiration":${PUB_DEV_PUBLISH_EXPIRATION} -} -EOF \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 8637bb3..6d39863 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: network_tools_flutter description: Extended features of network_tools package for flutter framework supporting iOS and Android -version: 2.0.2 +version: 2.0.3 issue_tracker: https://github.com/osociety/network_tools_flutter/issues repository: https://github.com/osociety/network_tools_flutter