diff --git a/.github/workflows/pub_publish.yml b/.github/workflows/pub_publish.yml index 3a51984..3b0aea4 100644 --- a/.github/workflows/pub_publish.yml +++ b/.github/workflows/pub_publish.yml @@ -1,17 +1,37 @@ name: Pub publish on: - release: - types: [published] + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' jobs: - publish: - name: Pub publish + verify: + name: Verify package runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - name: Checkout repository + uses: actions/checkout@v7 - - name: Publish - uses: k-paxian/dart-package-publisher@v1.6 + - name: Install Flutter + uses: subosito/flutter-action@v2 with: - credentialJson: ${{ secrets.CREDENTIALS }} + channel: stable + cache: true + + - name: Disable analytics + run: flutter config --no-analytics + + - name: Publish dry run + run: dart pub publish --dry-run + + - name: Flutter test + run: flutter test + + publish: + name: Pub publish + needs: verify + permissions: + contents: read + id-token: write + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 diff --git a/.github/workflows/pub_publish_dry_run.yml b/.github/workflows/pub_publish_dry_run.yml index fd2dff7..58ac4b6 100644 --- a/.github/workflows/pub_publish_dry_run.yml +++ b/.github/workflows/pub_publish_dry_run.yml @@ -11,10 +11,20 @@ jobs: name: Pub publish dry run runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - name: Checkout repository + uses: actions/checkout@v7 - - name: Publish dry run - uses: k-paxian/dart-package-publisher@v1.6 + - name: Install Flutter + uses: subosito/flutter-action@v2 with: - credentialJson: MockCredentialJson - dryRunOnly: true + channel: stable + cache: true + + - name: Disable analytics + run: flutter config --no-analytics + + - name: Publish dry run + run: dart pub publish --dry-run + + - name: Flutter test + run: flutter test