215 lines
7.2 KiB
YAML
215 lines
7.2 KiB
YAML
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
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
automation:
|
|
uses: ./.github/workflows/automation.yml
|
|
secrets: inherit
|
|
|
|
prepare-release-pr:
|
|
runs-on: ubuntu-22.04
|
|
|
|
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
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 }}' `
|
|
-requestedByUserName '${{ github.event.sender.login }}' `
|
|
-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-22.04
|
|
|
|
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, '[release] Prepare release ')
|
|
&& needs.automation.outputs.enabled
|
|
|
|
env:
|
|
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
|
|
|
|
steps:
|
|
- name: check out code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
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-pr-post-notice:
|
|
runs-on: ubuntu-22.04
|
|
|
|
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, '[release] 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
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 }}'
|
|
|
|
update-changelog-release-dates-on-prepare-pr-post-notice:
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: automation
|
|
|
|
if: |
|
|
github.event_name == 'issue_comment'
|
|
&& github.event.issue.pull_request
|
|
&& github.event.issue.state == 'open'
|
|
&& github.event.comment.user.login != needs.automation.outputs.username
|
|
&& contains(github.event.comment.body, '/UpdateReleaseDates')
|
|
&& startsWith(github.event.issue.title, '[release] Prepare release ')
|
|
&& github.event.issue.pull_request.merged_at == null
|
|
&& needs.automation.outputs.enabled
|
|
|
|
env:
|
|
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
|
|
|
|
steps:
|
|
- name: check out code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
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: Update release date
|
|
shell: pwsh
|
|
run: |
|
|
Import-Module .\build\scripts\prepare-release.psm1
|
|
|
|
UpdateChangelogReleaseDatesAndPostNoticeOnPullRequest `
|
|
-gitRepository '${{ github.repository }}' `
|
|
-pullRequestNumber '${{ github.event.issue.number }}' `
|
|
-botUserName '${{ needs.automation.outputs.username }}' `
|
|
-commentUserName '${{ github.event.comment.user.login }}' `
|
|
-gitUserName '${{ needs.automation.outputs.username }}' `
|
|
-gitUserEmail '${{ needs.automation.outputs.email }}'
|
|
|
|
update-releasenotes-on-prepare-pr-post-notice:
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: automation
|
|
|
|
if: |
|
|
github.event_name == 'issue_comment'
|
|
&& github.event.issue.pull_request
|
|
&& github.event.issue.state == 'open'
|
|
&& github.event.comment.user.login != needs.automation.outputs.username
|
|
&& contains(github.event.comment.body, '/UpdateReleaseNotes')
|
|
&& startsWith(github.event.issue.title, '[release] Prepare release ')
|
|
&& github.event.issue.pull_request.merged_at == null
|
|
&& needs.automation.outputs.enabled
|
|
|
|
env:
|
|
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
|
|
|
|
steps:
|
|
- name: check out code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
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: Update release notes
|
|
env:
|
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
shell: pwsh
|
|
run: |
|
|
Import-Module .\build\scripts\prepare-release.psm1
|
|
|
|
UpdateReleaseNotesAndPostNoticeOnPullRequest `
|
|
-gitRepository '${{ github.repository }}' `
|
|
-pullRequestNumber '${{ github.event.issue.number }}' `
|
|
-botUserName '${{ needs.automation.outputs.username }}' `
|
|
-commentUserName '${{ github.event.comment.user.login }}' `
|
|
-commentBody $Env:COMMENT_BODY `
|
|
-gitUserName '${{ needs.automation.outputs.username }}' `
|
|
-gitUserEmail '${{ needs.automation.outputs.email }}'
|