ci: Fix auto-release (#1074) #79
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To authenticate on pub.dev to publish a release via GitHub Actions, a tag | |
| # needs to be pushed, see: https://dart.dev/tools/pub/automated-publishing | |
| # | |
| # Publishing cannot currently be triggered manually via a "workflow_dispatch", | |
| # see: https://dart.dev/go/publishing-from-github | |
| name: release-automated | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - next-major | |
| tags: | |
| - "dart-[0-9]+.[0-9]+.[0-9]+*" | |
| - "flutter-[0-9]+.[0-9]+.[0-9]+*" | |
| env: | |
| package: ${{ startsWith(github.ref_name, 'dart-') && 'dart' || startsWith(github.ref_name, 'flutter-') && 'flutter' || '' }} | |
| jobs: | |
| release: | |
| if: github.event_name == 'push' && github.ref_type == 'branch' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run semantic-release for dart package | |
| run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
| PKG_NAME: dart | |
| - name: Run semantic-release for flutter package | |
| run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
| PKG_NAME: flutter |