diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index b836df6a..e18606fd 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -36,15 +36,19 @@ jobs: run: | sed -i "0,/\#\# \[.*/s//## [${{steps.changelog_reader.outputs.version}}-$GITHUB_RUN_ID]/" CHANGELOG.md cat CHANGELOG.md - - name: Setup credentials - run: | - cat < $PUB_CACHE/credentials.json - ${{ secrets.CREDENTIALS }} - EOF - - name: Publish package - run: flutter pub publish --force + outputs: + version: ${{steps.changelog_reader.outputs.version}}-$GITHUB_RUN_ID + publish: + needs: prerelease + permissions: + id-token: write # Required for authentication using OIDC + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + entry: + needs: [prerelease, publish] + runs-on: ubuntu-latest + steps: - name: Add entry to Github release uses: softprops/action-gh-release@v1 with: - tag_name: ${{ steps.changelog_reader.outputs.version }}+${{ github.run_id }} - prerelease: true \ No newline at end of file + tag_name: ${{ needs.prerelease.outputs.version }} + prerelease: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35967b42..db56afc7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,13 +25,15 @@ jobs: channel: "stable" - run: dart --version - run: flutter --version - - name: Setup credentials - run: | - cat < $PUB_CACHE/credentials.json - ${{ secrets.CREDENTIALS }} - EOF - - name: Publish package - run: flutter pub publish --force + publish: + needs: release + permissions: + id-token: write # Required for authentication using OIDC + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + entry: + needs: [release, publish] + runs-on: ubuntu-latest + steps: - name: Get Changelog Entry id: changelog_reader uses: mindsers/changelog-reader-action@v2.0.0 @@ -39,4 +41,4 @@ jobs: uses: softprops/action-gh-release@v1 with: tag_name: ${{ steps.changelog_reader.outputs.version }} - body: ${{ steps.changelog_reader.outputs.changes }} \ No newline at end of file + body: ${{ steps.changelog_reader.outputs.changes }}