[repo] Prepare release coreunstable-1.9.0-alpha.2 #152
This file contains 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: Prepare for a release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag-prefix: | |
type: choice | |
options: | |
- core- | |
- coreunstable- | |
description: 'Release tag prefix' | |
required: true | |
version: | |
type: string | |
description: 'Release version' | |
required: true | |
pull_request: | |
types: | |
- closed | |
issue_comment: | |
types: | |
- created | |
jobs: | |
automation: | |
uses: ./.github/workflows/automation.yml | |
secrets: inherit | |
prepare-release-pr: | |
runs-on: ubuntu-latest | |
needs: automation | |
if: github.event_name == 'workflow_dispatch' && needs.automation.outputs.enabled | |
env: | |
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }} | |
steps: | |
- name: check out code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets[needs.automation.outputs.token-secret-name] }} | |
- name: Create GitHub Pull Request to prepare release | |
shell: pwsh | |
run: | | |
Import-Module .\build\scripts\prepare-release.psm1 | |
CreatePullRequestToUpdateChangelogsAndPublicApis ` | |
-gitRepository '${{ github.repository }}' ` | |
-minVerTagPrefix '${{ inputs.tag-prefix }}' ` | |
-version '${{ inputs.version }}' ` | |
-targetBranch '${{ github.ref_name }}' ` | |
-gitUserName '${{ needs.automation.outputs.username }}' ` | |
-gitUserEmail '${{ needs.automation.outputs.email }}' | |
lock-pr-and-post-notice-to-create-release-tag: | |
runs-on: ubuntu-latest | |
needs: automation | |
if: | | |
github.event_name == 'pull_request' | |
&& github.event.action == 'closed' | |
&& github.event.pull_request.user.login == needs.automation.outputs.username | |
&& github.event.pull_request.merged == true | |
&& startsWith(github.event.pull_request.title, '[repo] Prepare release ') | |
&& needs.automation.outputs.enabled | |
env: | |
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }} | |
steps: | |
- name: check out code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets[needs.automation.outputs.token-secret-name] }} | |
- name: Lock GitHub Pull Request to prepare release | |
shell: pwsh | |
run: | | |
Import-Module .\build\scripts\prepare-release.psm1 | |
LockPullRequestAndPostNoticeToCreateReleaseTag ` | |
-gitRepository '${{ github.repository }}' ` | |
-pullRequestNumber '${{ github.event.pull_request.number }}' ` | |
-botUserName '${{ needs.automation.outputs.username }}' | |
create-release-tag-unlock-pr-post-notice: | |
runs-on: ubuntu-latest | |
needs: automation | |
if: | | |
github.event_name == 'issue_comment' | |
&& github.event.issue.pull_request | |
&& github.event.issue.locked == true | |
&& github.event.comment.user.login != needs.automation.outputs.username | |
&& contains(github.event.comment.body, '/CreateReleaseTag') | |
&& startsWith(github.event.issue.title, '[repo] Prepare release ') | |
&& github.event.issue.pull_request.merged_at | |
&& needs.automation.outputs.enabled | |
env: | |
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }} | |
steps: | |
- name: check out code | |
uses: actions/checkout@v4 | |
with: | |
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below | |
fetch-depth: 0 | |
token: ${{ secrets[needs.automation.outputs.token-secret-name] }} | |
- name: Create release tag | |
id: create-tag | |
shell: pwsh | |
run: | | |
Import-Module .\build\scripts\prepare-release.psm1 | |
CreateReleaseTagAndPostNoticeOnPullRequest ` | |
-gitRepository '${{ github.repository }}' ` | |
-pullRequestNumber '${{ github.event.issue.number }}' ` | |
-botUserName '${{ needs.automation.outputs.username }}' ` | |
-gitUserName '${{ needs.automation.outputs.username }}' ` | |
-gitUserEmail '${{ needs.automation.outputs.email }}' |