name: Publish to pub.dev on: push: tags: - 'v[0-9]+.[0-9]+.[0-9]+*' # Trigger this action when a version tag is pushed jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup Dart environment uses: dart-lang/setup-dart@v1 # If the package is not in the root, include a step to navigate to the package directory # - name: Change to package directory # run: cd path/to/your/package - name: Publish to pub.dev run: dart pub publish --force # This will fail without an access token for authentication unless you have a custom setup.