-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
<Content from 'CHANGELOG.md' here> | ||
- Perform a `cargo check` so that `Cargo.lock` is properly updated and run the tests `cargo test --target <your_machine_targe>`. | ||
|
||
- Commit everything with message `Preparing release of ${version}`. | ||
|
||
```bash | ||
git add -A . && git commit -m "Preparing release of ${version}" | ||
``` | ||
|
||
### Commits | ||
- Perform release | ||
|
||
<Auto-generated commits listing> | ||
```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 | ||
``` |