ci: add publish workflow #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |