Skip to content
Merged
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
41 changes: 31 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,45 @@ mentioned in [CHANGELOG.md](CHANGELOG.md), under the `## Unreleased` header.

## Release Process

### Prerequisites

Prerequisites to make a release:

```bash
cargo install cargo-release
cargo install cargo-dist
cargo install cargo-release --version 0.25.17
cargo install cargo-dist --version 0.28.0 --locked
```

- Use `cargo-release` version `0.25.17 `as the versions above require rustc `1.85` or newer, but the Rust toolchain for dfxvm is still `1.84.0` which is defined [here](./rust-toolchain.toml)
- Use `--locked` to install `cargo-dist` to avoid upgrading some dependencies to the latest versions which have compatibility problems.

You can run `cargo install --list` to make sure if you have the correct `cargo-release` and `cargo-dist` installed.

### Making a release

To make a release, follow these steps:

1. Run the [Prepare Release][prepare-release-workflow] workflow.
2. Obtain approval and merge the PR that the workflow generated.
3. Run the following locally:

```bash
git checkout main
git pull
cargo dist plan
cargo release --execute
```
Make sure you choose the right option to specify the correct [SemVer version](https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md#bump-level).

1. Obtain approval and merge the PR that the workflow generated.

The PR created by a workflow won't trigger other workflows according to this [document](https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow).You can simply use `git commit --allow-empty` to create an empty commit and push to trigger the jobs.

1. Run the following locally:

```bash
git checkout main
git pull
dist plan
cargo release --execute
```

- The `dist plan` command will get a plan of what to build, and check project status.
- The `cargo release --execute` will push the tag according to the version created by the PR in previsou step, and execute the [Release][release-workflow] workflow.

[code-of-conduct]: https://github.com/dfinity/ic-docutrack/blob/main/.github/CODE_OF_CONDUCT.md
[cla]: https://github.com/dfinity/cla/blob/master/CLA.md
[prepare-release-workflow]: https://github.com/dfinity/dfxvm/actions/workflows/prepare-release.yml
[release-workflow]: https://github.com/dfinity/dfxvm/actions/workflows/release.yml