Scheduled publishing - mikealfare #52
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
| # **what?** | |
| # Automatically publishes all adapter packages to the internal AWS CodeArtifact repository on a schedule. | |
| # **why?** | |
| # Ensures internal tools always have access to the latest versions of adapter packages. | |
| # **when?** | |
| # This workflow runs on a schedule every Sunday at midnight UTC. | |
| name: "Scheduled publishing" | |
| run-name: "Scheduled publishing - ${{ github.actor }}" | |
| on: | |
| schedule: | |
| - cron: "0 0 * * SUN" | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| strategy: | |
| matrix: | |
| package: | |
| - "dbt-athena" | |
| - "dbt-bigquery" | |
| - "dbt-postgres" | |
| - "dbt-redshift" | |
| - "dbt-snowflake" | |
| - "dbt-spark" | |
| fail-fast: false | |
| uses: ./.github/workflows/publish-internal.yml | |
| with: | |
| package: ${{ matrix.package }} | |
| secrets: inherit | |
| open-lockfile-pr: | |
| needs: publish | |
| runs-on: ${{ vars.DEFAULT_RUNNER }} | |
| steps: | |
| - name: "Trigger lockfile PR and get PR number" | |
| id: pr | |
| shell: bash | |
| run: | | |
| RUN_ID=$(gh workflow run $WORKFLOW --repo $REPO) | |
| echo $RUN_ID | |
| gh run watch $RUN_ID | |
| PR=$(gh pr list --repo $REPO --search "$PR_TITLE in:title" --json number | jq 'max .number') | |
| echo $PR | |
| echo "number=$PR" >> $GITHUB_OUTPUT | |
| env: | |
| GH_TOKEN: ${{ secrets.FISHTOWN_BOT_PAT }} | |
| REPO: "dbt-labs/dbt-mantle" | |
| WORKFLOW: "open-lockfile-pr.yml" | |
| PR_TITLE: "Generate new lockfile for dbt-mantle" | |
| - name: "Notify Slack" | |
| uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # ravsamhq/notify-slack-action@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| status: ${{ job.status }} | |
| notification_title: "dbt-mantle lockfile is ready for review" | |
| message_format: "View PR: https://github.com/dbt-labs/dbt-mantle/pull/${{ steps.pr.outputs.number }}" | |
| mention_groups: ${{ vars.SLACK_ON_CALL }} | |
| mention_groups_when: "success" | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEV_ADAPTER_PULL_REQUESTS }} |