v0.4.0 published by Daichi Fujita #5
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: Release new version | |
run-name: ${{ github.ref_name }} published by ${{ github.event.head_commit.author.name }} | |
on: | |
push: | |
tags: ["v[0-9]+.[0-9]+.[0-9]+*"] | |
env: | |
package_dir: ./ | |
example_dir: ./example | |
jobs: | |
publish: | |
name: Publish the package to pub.dev | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Dart | |
uses: dart-lang/setup-dart@v1 | |
- name: Install Flutter SDK | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- name: Flutter versioin | |
run: flutter --version | |
- name: Install dependencies | |
working-directory: ${{ env.package_dir }} | |
run: flutter pub get | |
- name: Code generation | |
working-directory: ${{ env.package_dir }} | |
run: dart run build_runner build | |
- name: Install pana | |
working-directory: ${{ env.package_dir }} | |
run: dart pub global activate pana | |
- name: Analize | |
working-directory: ${{ env.package_dir }} | |
run: pana --exit-code-threshold 0 --no-warning | |
- name: Dry run | |
working-directory: ${{ env.package_dir }} | |
run: flutter pub publish --dry-run | |
- name: Publish | |
working-directory: ${{ env.package_dir }} | |
if: success() | |
run: flutter pub publish --force | |
deploy-example: | |
needs: publish | |
permissions: | |
contents: write | |
uses: ./.github/workflows/deploy_example.yml |