Update ci.yml #4
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
# https://dart.dev/tools/pub/automated-publishing#hardening-security-with-tag-protection-rules-on-github | |
name: Publish to pub.dev | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' # tag pattern on pub.dev: 'v{{version}' | |
jobs: | |
analyze: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Analyze | |
run: dart analyze | |
- name: Format | |
run: dart format --set-exit-if-changed . | |
- name: Dry run | |
run: flutter pub publish --dry-run | |
test: | |
needs: analyze | |
uses: ./.github/workflows/ci.yml | |
publish: | |
needs: test | |
permissions: | |
id-token: write # Required for authentication using OIDC | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/setup-dart@v1 | |
- name: Dry run | |
run: flutter pub publish --dry-run | |
- name: Publish | |
run: dart pub publish |