name: Publish to pub.dev

on:
  push:
    tags:
    - '[0-9]+\.[0-9]+\.[0-9]+*'

jobs:
  publish:
    permissions:
      id-token: write # Required for authentication using OIDC
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dart-lang/setup-dart@v1
      - name: Install dependencies
        run: dart pub get
      - name: Publish
        run: dart pub publish --force
