| # A CI configuration to auto-publish pub packages from dart-lang/ecosystem. |
| |
| # We don't use the regular publish.yaml script here in order to dogfood the |
| # publishing code at head. |
| |
| name: Publish |
| |
| on: |
| pull_request: |
| branches: [ main ] |
| types: [opened, synchronize, reopened, labeled, unlabeled] |
| push: |
| tags: [ '[A-z]+-v[0-9]+.[0-9]+.[0-9]+' ] |
| |
| jobs: |
| publish: |
| if: github.repository_owner == 'dart-lang' |
| |
| # These permissions are required for authentication using OIDC and to enable |
| # us to create comments on PRs. |
| permissions: |
| id-token: write |
| pull-requests: write |
| |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 |
| - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f |
| |
| - name: Pub get |
| working-directory: pkgs/firehose |
| run: dart pub get |
| |
| - name: Validate packages |
| if: ${{ github.event_name == 'pull_request' }} |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| ISSUE_NUMBER: ${{ github.event.number }} |
| PR_LABELS: "${{ join(github.event.pull_request.labels.*.name) }}" |
| run: dart pkgs/firehose/bin/firehose.dart --validate |
| |
| - name: Publish tagged package |
| if: ${{ github.event_name == 'push' }} |
| run: dart pkgs/firehose/bin/firehose.dart --publish |