From 260a83a2140b4fbb5f87f4b051328543edd66b0d Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 24 Dec 2025 16:52:46 -0800 Subject: [PATCH] Refactor pub.dev publish step to use reusable workflow Replaces the manual publish step in the CI workflow with the dart-lang/setup-dart reusable workflow for publishing to pub.dev. Updates permissions and moves the publish logic to a separate job triggered on tag creation. --- .github/workflows/ci.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 319c11542..21703d343 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,9 +82,6 @@ jobs: build_flet_package: name: Build Flet Flutter package runs-on: ubuntu-latest - permissions: - contents: read - id-token: write # Required for authentication using OIDC (pub.dev trusted publisher) outputs: PKG_VER: ${{ steps.versions.outputs.PKG_VER }} BUILD_VER: ${{ steps.versions.outputs.BUILD_VER }} @@ -132,14 +129,19 @@ jobs: source "$SCRIPTS/common.sh" patch_pubspec_version ./pubspec.yaml "$PKG_VER" - - name: Publish to pub.dev (Release) - if: ${{ github.ref_type == 'tag' }} - env: - PUB_ENVIRONMENT: github-actions - shell: bash + # ======================================= + # Publish Flet Flutter package to pub.dev + # ======================================= + publish_flet_package: + name: Publish Flet Flutter package to pub.dev + if: ${{ github.ref_type == 'tag' }} + needs: + - build_flet_package + permissions: + id-token: write # Required for authentication using OIDC + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + with: working-directory: packages/flet - run: | - dart pub publish --force # ============================= # Build Flet Client for Windows