Prepare release #83
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
| # Caller stub: release preparation (stage 1). Worked example for podnotes (npm). | |
| # Copy to .github/workflows/release-prepare.yml and edit the per-repo values. | |
| # | |
| # The workflow_run trigger cannot live in the reusable workflow, so it lives | |
| # here. The single job forwards the tested commit (or a manually dispatched SHA) | |
| # to the reusable prepare workflow, which re-confirms the SHA is still the | |
| # default-branch head and opens/refreshes the standing release PR. | |
| # | |
| # Escape hatch: workflow_dispatch lets you plan manually (e.g. a dry-run smoke | |
| # test before your first release) without waiting for a CI completion. | |
| name: Prepare release | |
| on: | |
| workflow_run: | |
| # Must match the name: of your CI workflow (podnotes' CI workflow is "Test"). | |
| workflows: ["Test"] | |
| types: [completed] | |
| workflow_dispatch: | |
| inputs: | |
| targetSha: | |
| description: "Commit SHA to plan from (defaults to the default-branch head)" | |
| required: false | |
| type: string | |
| permissions: {} | |
| concurrency: | |
| group: release-prepare | |
| cancel-in-progress: false | |
| jobs: | |
| prepare: | |
| # Manual dispatch always runs; the automatic path only runs for a green | |
| # CI run from a push to the default branch. | |
| if: >- | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.workflow_run.conclusion == 'success' && | |
| github.event.workflow_run.event == 'push' && | |
| github.event.workflow_run.head_branch == 'master') | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: chhoumann/obsidian-plugin-workflows/.github/workflows/release-prepare.yml@ebcf84b80dc48ba15e0eec1f3575d41519a78ed5 # v4 | |
| with: | |
| plugin-name: podnotes | |
| package-manager: npm | |
| # Pin the commit-to-release policy so a toolkit update can never change it. | |
| release-policy: '[{"scope":"deps","type":"build","release":"patch"}]' | |
| default-branch: master | |
| node-version: "22" | |
| target-sha: ${{ github.event.workflow_run.head_sha || inputs.targetSha }} | |
| release-bot-app-slug: podnotes-release-bot | |
| app-id: ${{ vars.RELEASE_APP_ID }} | |
| # dry-run: true # plan only; skip opening the PR (smoke test) | |
| secrets: | |
| release-app-private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} |