Update publish workflow, filter on main branch #3
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
# .github/workflows/publish.yml | |
name: Publish to pub.dev | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' # tag pattern on pub.dev: 'v{{version}' | |
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 - dry run | |
run: dart pub publish --dry-run | |
- name: Fix Check | |
run: dart fix --dry-run | |
- name: Fix Apply | |
run: dart fix --apply | |
- name: Format | |
run: dart format . | |
- name: Publish | |
run: dart pub publish --force |