mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-03 11:18:31 +00:00
Document release process
This commit is contained in:
35
docs/dev/release.md
Normal file
35
docs/dev/release.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Release Process
|
||||||
|
|
||||||
|
The release process of wasmer is mostly automated, including generating the CHANGELOG,
|
||||||
|
tagging the release and starting the `build.yaml` action
|
||||||
|
|
||||||
|
In the `/scripts` folder, you will see three files:
|
||||||
|
|
||||||
|
- `update-version.py`: iterates through all `Cargo.toml` files and bumps the version number
|
||||||
|
according to `PREVIOUS_VERSION` and `NEXT_VERSION`
|
||||||
|
- `publish.py`: resolves the dependency order and publishes all crates to crates.io
|
||||||
|
- `make-release.py`: creates a new pull request from the current master branch, generates the
|
||||||
|
CHANGELOG, waits until all checks have passed and the release PR is merged, then starts the
|
||||||
|
GitHub action to trigger the actual release on GitHub.
|
||||||
|
|
||||||
|
In theory, all you need to do to create a new release is to look that master is green, then
|
||||||
|
run
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python3 scripts/make-release.py 3.2.0
|
||||||
|
python3 scripts/publish.py publish
|
||||||
|
```
|
||||||
|
|
||||||
|
After the GitHub release (first command), the crates need to be published to crates.io - the order
|
||||||
|
is important because if anything goes wrong in the first command or a release needs to be amended
|
||||||
|
because of last-minute fixes, we can still revert the GitHub release, but publishing on crates.io
|
||||||
|
is final because we can't yank crates (this has caused a lot of version-renumbering issues in the past).
|
||||||
|
|
||||||
|
## Issues to watch out for
|
||||||
|
|
||||||
|
There are a couple of problems with the scripts that you should watch out for:
|
||||||
|
|
||||||
|
- On the release pull request, the CHANGELOG might be generated incorrectly
|
||||||
|
- The script might fail (in this case there will be an audible message being read using the macos `say` command)
|
||||||
|
- The script might not trigger the `build.yaml` action, in some cases it has to be run manually
|
||||||
|
- Publishing to crates.io might fail because of new crates that have to be published manually
|
||||||
@@ -266,41 +266,6 @@ def make_release(version):
|
|||||||
print("Waiting for checks to pass... PR " + pr_number + " https://github.com/wasmerio/wasmer/pull/" + pr_number)
|
print("Waiting for checks to pass... PR " + pr_number + " https://github.com/wasmerio/wasmer/pull/" + pr_number)
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
|
|
||||||
if not(already_released):
|
|
||||||
# PR created, checks have passed, run python script and publish to crates.io
|
|
||||||
proc = subprocess.Popen(['gh','pr', "comment", pr_number, "--body", "[bot] Checks have passed. Publishing to crates.io..."], stdout = subprocess.PIPE, cwd = temp_dir.name)
|
|
||||||
proc.wait()
|
|
||||||
|
|
||||||
proc = subprocess.Popen(['python3',temp_dir.name + "/scripts/publish.py", "publish"], stdout = subprocess.PIPE, cwd = temp_dir.name)
|
|
||||||
while True:
|
|
||||||
line = proc.stdout.readline()
|
|
||||||
line = line.decode("utf-8").rstrip()
|
|
||||||
print(line.rstrip())
|
|
||||||
if not line: break
|
|
||||||
|
|
||||||
proc.wait()
|
|
||||||
|
|
||||||
if proc.returncode != 0:
|
|
||||||
log = ["[bot] Failed to publish to crates.io"]
|
|
||||||
log.append("")
|
|
||||||
log.append("```")
|
|
||||||
for line in proc.stdout:
|
|
||||||
line = line.decode("utf-8").rstrip()
|
|
||||||
log.append("stdout: " + line)
|
|
||||||
log.append("```")
|
|
||||||
log.append("```")
|
|
||||||
if proc.stderr is not None:
|
|
||||||
for line in proc.stderr:
|
|
||||||
line = line.decode("utf-8").rstrip()
|
|
||||||
log.append("stderr: " + line)
|
|
||||||
log.append("```")
|
|
||||||
proc = subprocess.Popen(['gh','pr', "comment", pr_number, "--body", "\r\n".join(log)], stdout = subprocess.PIPE, cwd = temp_dir.name)
|
|
||||||
proc.wait()
|
|
||||||
raise Exception("Failed to publish to crates.io: " + "\r\n".join(log))
|
|
||||||
else:
|
|
||||||
proc = subprocess.Popen(['gh','pr', "comment", pr_number, "--body", "[bot] Successfully published wasmer version " + RELEASE_VERSION + " to crates.io"], stdout = subprocess.PIPE, cwd = temp_dir.name)
|
|
||||||
proc.wait()
|
|
||||||
|
|
||||||
last_commit = ""
|
last_commit = ""
|
||||||
proc = subprocess.Popen(['git','log'], stdout = subprocess.PIPE, cwd = temp_dir.name)
|
proc = subprocess.Popen(['git','log'], stdout = subprocess.PIPE, cwd = temp_dir.name)
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|||||||
Reference in New Issue
Block a user