From 826b29ec5b1e23d7d78e8ed7294f35a479f29962 Mon Sep 17 00:00:00 2001 From: crow Date: Sat, 9 Nov 2024 12:55:45 -0800 Subject: [PATCH] Update release to use OIDC token with dry run flag --- .github/workflows/release.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 899b77cd..fc811082 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,13 @@ on: push: tags: - "[0-9]+.[0-9]+.[0-9]+*" + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run (no actual publish)' + required: false + type: boolean + default: false env: DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer @@ -62,11 +69,18 @@ jobs: flutter-version: ${{ env.FLUTTER_VERSION }} - run: flutter pub get - - uses: dart-lang/setup-dart@v1 - - name: Publish Dart/Flutter package - run: flutter pub publish --force + - name: Publish to pub.dev + if: ${{ !inputs.dry_run }} + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + + - name: Dry Run Publish to pub.dev + if: ${{ inputs.dry_run }} + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + with: + dry-run: true - name: Github Release + if: ${{ !inputs.dry_run }} uses: actions/create-release@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -88,6 +102,7 @@ jobs: release-docs: runs-on: macos-14-xlarge needs: [ ci, release-plugin ] + if: ${{ !inputs.dry_run }} steps: - uses: actions/checkout@v3