@@ -12,7 +12,7 @@ subgroup](https://github.com/bytecodealliance/meetings/tree/main/SIG-Guest-Langu
1212meetings and the Guest Languages [ Zulip
1313channel] ( https://bytecodealliance.zulipchat.com/#narrow/stream/394175-SIG-Guest-Languages ) .
1414
15- ## Building from source
15+ ## Building from Source
1616
1717### Prerequisites
1818
@@ -52,3 +52,53 @@ Finally, build and run `componentize-py`.
5252``` shell
5353cargo run --release -- --help
5454```
55+
56+ ## Publishing Releases
57+
58+ The release process currently requires several manual steps, unfortunately.
59+ Automating this as part of CI would be great!
60+
61+ In the following, we'll pretend we're bumping the version from 0.22.1 to 0.23.0.
62+ Remember to replace those numbers with the ones applicable to your release.
63+
64+ The first step is to update the version number in Cargo.toml, pyproject.toml,
65+ and the examples. We can use this bash one-liner:
66+
67+ ``` shell
68+ for x in $( find examples/ -name README.md) Cargo.toml pyproject.toml; do sed -i ' s/0\.22\.1/0.23.0/' $x ; done
69+ ```
70+
71+ Note that that's a bit sketchy since it will match any ` 0.22.1 ` string, meaning
72+ if we have a dependency with the same version number, it will get bumped also.
73+ Be sure to run ` git diff ` and verify everything looks right before proceeding,
74+ and make manual edits if necessary.
75+
76+ Next, commit your changes and open a PR. Once that PR is merged, tag and sign
77+ the commit using ` git tag -s v0.23.0 ` and push it using e.g. ` git push v0.23.0 ` .
78+
79+ Merging the PR to main will also kick off a release build, updating the ` canary `
80+ release. When that finishes, go to the [ canary release
81+ page] ( https://github.com/bytecodealliance/componentize-py/releases/tag/canary )
82+ and download the ` componentize_py-0.23.0-*.whl ` and
83+ ` componentize_py-0.23.0.tar.gz ` file, move them into a newly-created ` dist `
84+ directory, and run the following:
85+
86+ ``` shell
87+ python3 -m venv venv
88+ source venv/bin/activate
89+ pip install twine --upgrade
90+ twine upload dist/*
91+ ```
92+
93+ You'll be prompted for an auth token. If you don't have one and think you
94+ should, please open an issue on this repository.
95+
96+ The above will publish Python wheels to pypi.org. To publish to crates.io,
97+ you'll need to do the following:
98+
99+ ``` shell
100+ cargo login
101+ bash stage.sh && (cd target/staged && cargo publish)
102+ ```
103+
104+ Again, you'll need an auth token; open an issue if you need one.
0 commit comments