From c55fd795b2f69b34c1587630ef596f0e7147558f Mon Sep 17 00:00:00 2001 From: Alex <51419598+alexrintt@users.noreply.github.com> Date: Fri, 16 Feb 2024 04:06:56 -0300 Subject: [PATCH] Update publish.yaml --- .github/workflows/publish.yaml | 41 ++++++++-------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 0512026..6d79fe4 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,37 +1,14 @@ -name: Publish new plugin version +name: Publish to pub.dev + on: - workflow_dispatch: push: - branches: - - release + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' jobs: publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v2 - with: - flutter-version: "3.7.7" - channel: "stable" - - run: | - flutter --version - flutter pub get - flutter analyze --fatal-infos - - - name: Create credentials file - run: echo $PUB_CREDENTIALS > ~/pub-credentials.json - env: - PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} - - - name: Add credentials to Dart folder - run: | - mkdir -p ${XDG_CONFIG_HOME:-${HOME:-default}}/dart - touch ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json - cp ~/pub-credentials.json ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json - env: - PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} - - - name: Publish - run: dart pub publish --force + permissions: + id-token: write # Required for authentication using OIDC + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + # with: + # working-directory: path/to/package/within/repository