ci: Publish to crates.io in release.yml after tagging (#1152)

Fixed #1046

so that we don't have to manually run `cargo-publish` after the CI is
merged.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-06-21 20:04:09 +10:00 committed by GitHub
parent d8419ea5a2
commit abecd9ae14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 20 deletions

View file

@ -13,26 +13,11 @@ This is a release PR for **<%= crate.name %>** version **<%= version.actual %>**
**Use squash merge.**
<% if (crate.name == "cargo-binstall") { %>
Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, and create a GitHub release with the release notes below.
You will still need to manually publish the cargo crate:
```
$ git switch main
$ git pull
$ git switch --detach v<%= version.actual %>
$ cargo publish -p <%= crate.name %>
```
Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI,
create a GitHub release with the release notes below
<% } else { %>
Upon merging, this will create the tag `<%= crate.name %>-v<%= version.actual %>`.
You will still need to manually publish the cargo crate:
```
$ git switch main
$ git pull
$ git switch --detach <%= crate.name %>-v<%= version.actual %>
$ cargo publish -p <%= crate.name %>
```
<% } %>
Upon merging, this will create the tag `<%= crate.name %>-v<%= version.actual %>`
<% } %>, and CI will publish to crates.io on merge of this PR.
**To trigger builds initially, close and then immediately re-open this PR once.**