diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..179dd86 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: Publish to pub.dev + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+*' + +# based on dart-lang/setup-dart/.github/workflows/publish.yml@v1 +# custimized for flutter + +jobs: + publish: + name: 'Publish to pub.dev' + permissions: + id-token: write # Required for authentication using OIDC + runs-on: ubuntu-latest + steps: + # Checkout repository + - uses: actions/checkout@v4 + + # Setup Dart SDK with JWT token + - uses: dart-lang/setup-dart@v1 + with: + sdk: stable + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + + # Minimal package setup and dry run checks. + - name: Install dependencies + run: flutter pub get + - name: Publish - dry run + run: dart pub publish --dry-run + + # Publishing... + - name: Publish to pub.dev + run: dart pub publish -f