ci: trigger canary release #19
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: release-please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '1 0 * * *' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| # 1. THE CORE RELEASE-PLEASE JOB | |
| # This job runs on push (to finalize release) and on schedule (to create/update PR). | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| # 2. STABLE RELEASE FLOW (Runs ONLY when a new tag is created by release-please) | |
| # This only runs when `release_created` is true (after a release PR is merged). | |
| build-stable: | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main | |
| secrets: inherit | |
| with: | |
| node-version: '22' | |
| upload_artifacts: true | |
| skip_sonar: true | |
| publish: | |
| needs: build-stable | |
| secrets: inherit | |
| uses: City-of-Helsinki/.github/.github/workflows/ci-npm-publish.yml@main | |
| with: | |
| node-version: '22' | |
| use-ci-build: true | |
| # 3. CANARY RELEASE FLOW (Runs on every push to main, EXCLUDING schedule) | |
| # The event name is 'push' when a commit is pushed to main. | |
| # (FYI: The event name is 'schedule' when the cron runs.) | |
| build-canary: | |
| # This conditional ensures it runs ONLY when the workflow was triggered by a commit push. | |
| if: github.event_name == 'push' | |
| uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main | |
| secrets: inherit | |
| with: | |
| node-version: '22' | |
| upload_artifacts: true | |
| skip_sonar: true | |
| publish-npm-canary: | |
| # This conditional is redundant but good practice; it will only run if its dependency runs. | |
| if: github.event_name == 'push' | |
| needs: build-canary | |
| secrets: inherit | |
| uses: City-of-Helsinki/.github/.github/workflows/ci-npm-publish.yml@main | |
| with: | |
| node-version: '22' | |
| use-ci-build: true | |
| canary: true |