From d7659af32ededa552e50124a718f05a5bea8bb36 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Fri, 9 Jun 2023 13:20:46 -0400 Subject: [PATCH] Updated release instructions --- RELEASE.md | 56 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 0f7f1c8..515c59d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,30 +1,48 @@ -## Substreams Crates Release Instructions +## Release Process ### Instructions -> *Important* Do not forget to replace `${version}` by your real version like `0.1.3` in the commands below! +> **Warning** Do not forget to replace `${version}` by your real version like `0.1.3` in the commands below! (`export version=0.1.3`) -- Ensure you are in a clean and pushed Git state -- Find & replace all occurrences of Regex `^version = "[^"]+"` in all `Cargo.toml` files to `version = "${version}"` -- Find & replace all occurrences of Regex `^ version: [^"]+` in all `substreams.yaml` files to ` version: v${version}` (**Spaces are important**) -- Ensure build `cargo build --release` and tests `cargo test --target aarch64-apple-darwin` (adapt `--target` value to fit your machine's architecture) -- Update the [CHANGELOG.md](CHANGELOG.md) to update the `## Unreleased` header to become `## [${version}](https://github.com/streamingfast/substreams-sink-database-changes/releases/tag/v${version})` -- Ensure that Keybase is running and you are logged in -- Ensure that `cargo login` has been done in your terminal -- Commit everything with message `Preparing release of ${version}`. -- `./bin/release.sh -f v${version}` -- If everything goes well, `crates.io` will be update and Git should be in a synced state (the release script does a `git push` of the branch and the tag). -- Go to https://github.com/streamingfast/substreams-rs/releases/tag/v${version} and update the release notes, use content of section `## [v${version}]` in [docs/release-notes/change-log.md](../docs/release-notes/change-log.md), edit GitHub release and paste content before commits listing, keep both: +You will need [sfreleaser](https://github.com/streamingfast/sfreleaser) (install from source using Golang with `go install github.com/streamingfast/sfreleaser/cmd/sfrelease@latest`) to perform the release process. + +- Find & replace all occurrences of Regex `^version = "[^"]+"` in all `Cargo.toml` files to `version = "${version}"` and update the [CHANGELOG.md](CHANGELOG.md) to update the `## Unreleased` header to become `## ${version}`. Also don't forget to update `substreams.yaml` version. + + Using [sd](https://github.com/chmln/sd): + ```bash + find . -type f -name Cargo.toml -not -path "./target/*" | xargs -n1 sd '^version = "[^"]+"' "version = \"${version}\"" + sd '## Unreleased' "## v{version}" CHANGELOG.md + sd 'version: v.*' "version: v${version}" substreams.yaml ``` - ## Changelog - +- Perform a `cargo check` so that `Cargo.lock` is properly updated and run the tests `cargo test --target `. + +- Commit everything with message `Preparing release of ${version}`. + + ```bash + git add -A . && git commit -m "Preparing release of ${version}" + ``` - ### Commits +- Perform release - + ```bash + sfreleaser release ``` -- Update the [CHANGELOG.md](CHANGELOG.md) adding `## Unreleased` header on top of latest released section. -- Commit everything with message `Preparing next unreleased version`. +#### Easy script + +```bash +# Update to correct version! +export version=0.1.3 + +find . -type f -name Cargo.toml -not -path "./target/*" | xargs -n1 sd '^version = "[^"]+"' "version = \"${version}\"" +sd '## Unreleased' "## v{version}" CHANGELOG.md +sd 'version: v.*' "version: v${version}" substreams.yaml + +cargo check + +git add -A . && git commit -m "Preparing release of ${version}" + +sfreleaser release +``` \ No newline at end of file