* Change the bump-version workflow's schedule Either I don't understand cron or GitHub doesn't understand cron. It's not clear which. I think that https://github.com/bytecodealliance/wasmtime/pull/3511 may have fallen within our schedule but it was supposed to be on a weekday. Otherwise https://github.com/bytecodealliance/wasmtime/pull/3499 was certainly spurious. This commit moves to a simpler "just do it on the same day each month" and we can manually figure out weekdays and such. Hopefully this should reduce the number of spurious PRs we're getting to bump versions. This also removes the script to force a version bump since I found a button on the GitHub UI to do the same thing. Additionally I've updated the patch-release documentation to use this button. Note that this button takes inputs as well which means we can further automate patch releases to look even more like normal release process, differing only in one part of the argument used to trigger the workflow. * Fix a typo
102 lines
4.0 KiB
YAML
102 lines
4.0 KiB
YAML
# The purpose of this workflow is to, once a month, trigger Wasmtime's release
|
|
# process. All that actually happens here is that whenever this is triggered it
|
|
# will send a PR to the main repository with the version numbers automatically
|
|
# bumped. The next stage of the process is to simply merge the PR, and the
|
|
# `push-tag.yml` process takes over from there.
|
|
#
|
|
# Note that this creates a commit and a PR with a personal access token to
|
|
# ensure that the PR gets CI triggered on it. Additionally the commit message
|
|
# is specifically worded to get recognized by `push-tag.yml`.
|
|
|
|
name: "Bump version number"
|
|
on:
|
|
schedule:
|
|
# “At 00:00 on day-of-month 5.”
|
|
#
|
|
# https://crontab.guru/#0_0_5_*_*
|
|
- cron: '0 0 5 * *'
|
|
|
|
# Allow manually triggering this request via the button at
|
|
# https://github.com/bytecodealliance/wasmtime/actions/workflows/bump-version.yml
|
|
workflow_dispatch:
|
|
inputs:
|
|
publish_cmd:
|
|
description: 'Publish script argument: "bump" or "bump-patch"'
|
|
required: false
|
|
default: 'bump'
|
|
|
|
jobs:
|
|
bump_version:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- run: rustup update stable && rustup default stable
|
|
- name: Bump versions locally
|
|
id: bump
|
|
run: |
|
|
rustc scripts/publish.rs
|
|
if [ "${{ github.event.inputs.publish_cmd }}" != "" ]; then
|
|
# this was manually triggered
|
|
./publish ${{ github.event.inputs.publish_cmd }}
|
|
else
|
|
# this was cron-triggered.
|
|
./publish bump
|
|
fi
|
|
version=$(grep '^version =' Cargo.toml | head -n 1 | sed 's/.*"\(.*\)"/\1/')
|
|
echo "::set-output name=version::$version"
|
|
|
|
- name: Commit version changes
|
|
run: |
|
|
git config user.name 'Wasmtime Publish'
|
|
git config user.email 'wasmtime-publish@users.noreply.github.com'
|
|
git commit -a -F-<<EOF
|
|
Bump Wasmtime to ${{ steps.bump.outputs.version }}
|
|
|
|
[automatically-tag-and-release-this-commit]
|
|
EOF
|
|
|
|
- name: Push to remote
|
|
run: |
|
|
git remote set-url origin https://git:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${{ github.repository }}
|
|
git push origin main:ci/bump-version -f
|
|
|
|
- name: Make a PR
|
|
# Note that the syntax here is kinda funky, and the general gist is that
|
|
# I couldn't figure out a good way to have a multiline string-literal
|
|
# become a json-encoded string literal to send to GitHub. This
|
|
# represents my best attempt.
|
|
run: |
|
|
cat > pr-body <<-EOF
|
|
This is an automated pull request from CI which is intended to
|
|
notify maintainers that it's time to release Wasmtime version
|
|
${{ steps.bump.outputs.version }}. Version numbers have been bumped
|
|
in this PR automatically and the release process will automatically
|
|
enter the next stages once this PR is merged.
|
|
|
|
It's recommended that maintainers double-check that [RELEASES.md]
|
|
is up-to-date. If not please feel free to push to this PR any
|
|
modifications to the release notes. Additionally before merging it's
|
|
probably best to double-check the [release process] and make sure that
|
|
everything is ship-shape.
|
|
|
|
[RELEASES.md]: https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md
|
|
[release process]: https://docs.wasmtime.dev/contributing-release-process.html
|
|
EOF
|
|
body=$(jq -sR < ./pr-body)
|
|
|
|
curl --include --request POST \
|
|
https://api.github.com/repos/${{ github.repository }}/pulls \
|
|
--header "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
|
|
--data @- << EOF
|
|
{
|
|
"head": "ci/bump-version",
|
|
"base": "main",
|
|
"title": "Release Wasmtime ${{ steps.bump.outputs.version }}",
|
|
"body": $body,
|
|
"maintainer_can_modify": true
|
|
|
|
}
|
|
EOF
|