Publish JS SDK Canary Scheduler #27
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
| # This workflow is responsible for scheduling the JavaScript SDK canary publish workflow on a daily basis. | |
| # The actual publish workflow is defined in `publish-js-sdk.yaml`, which is triggered by this scheduler workflow. | |
| # `publish-js-sdk.yaml` has to be where the publish actually happens so that npm trusted publishing still works. | |
| # npm trusted publishing that only one workflow can publish to npm. | |
| name: Schedule JavaScript SDK Canary Publish | |
| concurrency: | |
| group: publish-js-sdk-canary-scheduler | |
| cancel-in-progress: false | |
| on: | |
| schedule: | |
| - cron: "17 6 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| dispatch-canary-publish: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Dispatch publish workflow | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: "publish-js-sdk.yaml", | |
| ref: "main", | |
| inputs: { | |
| release_type: "canary", | |
| branch: "main", | |
| }, | |
| }); | |
| - name: Summarize dispatch | |
| run: | | |
| { | |
| echo "## JavaScript SDK Canary Dispatch Queued" | |
| echo | |
| echo "- Workflow: \`publish-js-sdk.yaml\`" | |
| echo "- Release type: \`canary\`" | |
| echo "- Branch: \`main\`" | |
| } >> "$GITHUB_STEP_SUMMARY" |