Check pub.dev and Notify Discord #11
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
| name: Check pub.dev and Notify Discord | |
| on: | |
| workflow_run: | |
| workflows: ["Publish to pub.dev"] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| inputs: | |
| force_check: | |
| description: "Force check even if version exists" | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| check-and-notify: | |
| runs-on: ubuntu-latest | |
| # Only run if the publish workflow succeeded or if manually triggered | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Wait for pub.dev processing | |
| if: github.event_name == 'workflow_run' | |
| run: | | |
| echo "Waiting 2 minutes for pub.dev to process the publication..." | |
| sleep 120 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.9" | |
| - name: Install dependencies | |
| run: pip install requests pyyaml | |
| - name: Check pub.dev and notify | |
| env: | |
| DISCORD_RELEASE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} | |
| DISCORD_MAP: ${{ secrets.DISCORD_MAP }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPO_NAME: ${{ github.repository }} | |
| FORCE_CHECK: ${{ inputs.force_check }} | |
| run: python .github/scripts/check_pubdev_and_notify.py |