pulumi/.github/workflows/release-pr.yml

83 lines
2.3 KiB
YAML
Raw Normal View History

2022-09-02 05:40:13 +00:00
name: Post-Release PR
permissions:
# To create a PR
contents: write
pull-requests: write
on:
workflow_call:
inputs:
ref:
required: true
description: "GitHub ref to use"
type: string
version:
required: true
description: "Version to produce"
type: string
branch_from_ref:
required: false
description: "Commit to branch from, if not the tag"
type: string
release-notes:
required: true
description: "Release notes to publish"
type: string
queue-merge:
required: false
default: false
description: "Whether to queue the release for immediate merge"
type: boolean
jobs:
version-bump:
name: version bump
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.0' # decoupled from version sets, only used by changelog tool
2022-09-02 05:40:13 +00:00
- name: Create PR
env:
PULUMI_VERSION: ${{ inputs.version }}
RELEASE_NOTES: ${{ inputs.release-notes }}
QUEUE_MERGE: ${{ inputs.queue-merge }}
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
run: |
set -euo pipefail
git switch --create "automation/release-v${PULUMI_VERSION}"
2022-09-02 05:40:13 +00:00
echo -en "# Changelog\n\n${RELEASE_NOTES}\n\n$(tail -n+3 CHANGELOG.md)" > ./CHANGELOG.md
git config user.name github-actions
git config user.email github-actions@github.com
rm ./changelog/pending/*.yaml || true
git add -A
git commit -m "chore: changelog for v${PULUMI_VERSION}"
2022-09-02 05:40:13 +00:00
# Update go module dependencies
(
cd pkg
go get -u "github.com/pulumi/pulumi/sdk/v3@v${PULUMI_VERSION}"
)
make tidy
git add -A
git commit -m "chore: post-release go.mod updates"
2022-09-02 05:40:13 +00:00
# Publish pkg module on another tag.
git tag "pkg/v${PULUMI_VERSION}"
git push origin "pkg/v${PULUMI_VERSION}"
git push -u origin HEAD
PR=$(gh pr create --title "Changelog and go.mod updates for v${PULUMI_VERSION}" --body "")
ci: Remove Bors (#13715) # Description This PR removes Bors in favor of native GitHub merge queues. A very similar cutover was tested and verified in https://github.com/pulumi/watchutil-rs/pull/39. # Deployment plan * [x] Find some time where PRs aren't being merged. This is mostly to minimize confusion while we're futzing with branch protections. * [x] Update the repo's branch protection rules to match https://github.com/pulumi/watchutil-rs/pull/38: * "Allow specified actors to bypass required pull requests": "bors" → Unchecked * "Status checks that are required": "bors" → "ci-ok" * "Require merge queue": Unchecked → Checked * "Only merge non-failing pull requests" → Unchecked * "Merge method" → Squash and merge * [ ] Merge this PR using the "Merge when ready" button. * [ ] If it merges successfully: confirm the prepare-release step ran and published pre-release artifacts. * [ ] If the merge fails: it's possible we'll need to tweak steps slightly (e.g. if the step's name doesn't match the branch protection rule). The end goal is a "ci-ok" step in both the PR and merge workflows that captures whether everything is green. * [ ] If the issues aren't immediately resolvable, revert the changes made to branch protection settings. Folks will continue to merge with Bors. If all goes well, we should be able to continue merging with MQ for a while -- at least long enough to cut a new CLI release. Once we're confident we won't need to roll back: * [ ] Delete branch protection rules for: * staging * testing * [ ] Remove pu/pu from https://app.bors.tech/repositories Fixes https://github.com/pulumi/pulumi/issues/13501 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-08-12 01:36:48 +00:00
2022-09-02 05:40:13 +00:00
if [ "${QUEUE_MERGE}" = "true" ]; then
gh pr merge --auto --squash "${PR}"
2022-09-02 05:40:13 +00:00
fi