Skip to content
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

ci: automatically push to crates.io on release #462

Merged
merged 8 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow publishes the `ibc` on crates.io when a semver tag is
# pushed to main.
name: Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v0.26.0, v1.0.0
- "v[0-9]+.[0-9]+.[0-9]+-pre.[0-9]+" # e.g. v0.26.0-pre.1

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Publish crate
run: |
cd crates/ibc
cargo publish --token ${{ secrets.CRATES_TOKEN }}
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,19 @@ Our release process is as follows:
3. Bump all relevant versions in the `crates/ibc/Cargo.toml` file (making sure
dependencies' versions are updated too) to the new version and push these
changes to the release PR.

4. In the `crates/ibc/` directory, run `cargo doc --all-features --open` locally to double-check that all the
plafer marked this conversation as resolved.
Show resolved Hide resolved
documentation compiles and seems up-to-date and coherent. Fix any potential
issues here and push them to the release PR.
5. In the `crates/ibc/` directory, run `cargo publish --dry-run` to double-check that publishing will work. Fix
any potential issues here and push them to the release PR.
6. Mark the PR as **Ready for Review** and incorporate feedback on the release.
7. Once approved, merge the PR, and pull the `main` branch.
8. From the `crates/ibc` folder, run `cargo publish`
9. Once all crates have been successfully released, create a signed tag and push it to
8. Once all crates have been successfully released, create a signed tag and push it to
GitHub: `git tag -s -a vX.Y.Z`. In the tag message, write the version and the link
to the corresponding section of the changelog.
10. Once the tag is pushed, create a GitHub release and append
`[📖CHANGELOG](https://github.com/cosmos/ibc-rs/blob/main/CHANGELOG.md#vXYZ)`
to the corresponding section of the changelog. Pushing the tag will trigger the [Release workflow](https://github.com/cosmos/ibc-rs/actions/workflows/release.yml),
which publishes the crate on crates.io.
9. Once the tag is pushed, create a GitHub release and append
`[📖CHANGELOG](https://github.com/cosmos/ibc-rs/blob/main/CHANGELOG.md#vXYZ)`
to the release description.
10. Make sure that the [Release workflow](https://github.com/cosmos/ibc-rs/actions/workflows/release.yml) to crates.io has completed successfully.
11. All done! 🎉