diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..6e6032cfb --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 76efed06f..43714647d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -254,7 +254,6 @@ 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 documentation compiles and seems up-to-date and coherent. Fix any potential issues here and push them to the release PR. @@ -262,11 +261,12 @@ Our release process is as follows: 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! 🎉