Skip to content

Forui Hooks Publish

Forui Hooks Publish #4

name: Forui Hooks Publish
on:
workflow_dispatch: {}
push:
tags:
- 'forui_hooks/**'
jobs:
publish:
name: Publish to pub.dev
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: forui_hooks
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2.23.0
with:
flutter-version: 3.x
- id: auth
uses: google-github-actions/auth@v3
with:
workload_identity_provider: ${{ vars.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}
token_format: 'id_token'
id_token_audience: 'https://pub.dev'
id_token_include_email: true
- working-directory: forui
run: |
flutter pub get
dart run build_runner build
- run: flutter pub get
- run: dart pub token add https://pub.dev --env-var=PUB_TOKEN
- run: dart pub publish --force
env:
PUB_TOKEN: ${{ steps.auth.outputs.id_token }}