-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-1674: Automate Driver Releases #1538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Create packages for Windows in package workflow * Extract and reuse Windows build workflow * Don't create artifacts when not necessary
d21c676
to
88d08de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmikola left some explanatory comments in here. I still need to figure out why the changelog is not read correctly from the tag (it reads the message of the underlying commit instead of the message of the annotated tag), but other than that this is ready for a first look.
I revamped the release documentation significantly but left it in the current place. Once you've looked through and it looks good, I'd extract the release documentation to a RELEASING.md file as we've done for PHPLIB.
- name: "Read changelog from draft release" | ||
run: gh release view ${{ env.PACKAGE_VERSION }} --json body --template '{{ .body }}' >> changelog | ||
|
||
# TODO: Sign tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be done in a later step as we currently don't have the signing infrastructure in place.
run-name: "Release ${{ inputs.version }}" | ||
|
||
on: | ||
workflow_dispatch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow_dispatch
allows a manual trigger by anyone with write access to the repository. If we want to limit the number of people that can start a release, we'd have to add checks in this workflow, but I don't think that's necessary at this point.
./bin/update-release-version.php patch | ||
git commit -m "Back to -dev" phongo_version.h | ||
|
||
# TODO: Manually merge using ours strategy. This avoids merge-up pull requests being created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer this to a separate PR as it requires some work to make this logic from the merge-up action reusable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to ticket this if needed so we don't lose track of it.
I assume we already have a ticket to track the earlier TODO for release signing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CONTRIBUTING.md
Outdated
conflict, follow the "Ignoring Changes" section in the pull request to resolve | ||
the conflicts and merge the pull request once the build completes. | ||
|
||
### Manual release process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to keep the old documentation in place for the time being - the release workflow currently supports stable releases but no pre-releases. I plan to add support for pre-releases as well as that will be necessary when 2.0 comes around.
@@ -22,7 +22,7 @@ | |||
* publishing a release. */ | |||
|
|||
/* clang-format off */ | |||
#define PHP_MONGODB_VERSION "1.18.2-dev" | |||
#define PHP_MONGODB_VERSION "1.18.2dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During testing, I was trying to create a package with devel
stability and PECL complained that the -dev
suffix is wrong. I dislike that difference, but hopefully it won't be much longer until we can finally say goodbye to pecl.
# PECL always uses the version for the package name. | ||
# Read it from the version file and store in env to use when uploading artifacts | ||
- name: "Read current package version" | ||
run: echo "PACKAGE_VERSION=$(./bin/update-release-version.php version)" >> "$GITHUB_ENV" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You appear to only reference ${{ env.PACKAGE_VERSION }}
when constructing the tgz filename. Why not store the generated package filename as an environment variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at that initially, but couldn't figure out the correct shell syntax to only print the filename of the generated file. Relying on the naming convention in combination with extracting the version number seemed like a sensible alternative.
* Fix wrong version number format * Clarify manual release process steps * Add section on announcing releases * Fix wrong heading level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions to address but LGTM with or without changes.
./bin/update-release-version.php patch | ||
git commit -m "Back to -dev" phongo_version.h | ||
|
||
# TODO: Manually merge using ours strategy. This avoids merge-up pull requests being created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to ticket this if needed so we don't lose track of it.
I assume we already have a ticket to track the earlier TODO for release signing.
PHPC-1674
This PR adds release automation to reduce the number of manual steps required for the release. Manual steps are now limited to branch management (i.e. creating a new version branch before releasing a minor version) and merging up release commits. The commit process (e.g. changing to a stable version number in phongo_version.h), tagging a release, and building release artifacts including a PECL archive are now automated.
Signing release artifacts will be part of a separate PR.
Todo list:
make package.xml