From 13cecb58f5644313c260ae9d5bfb0767d25bf389 Mon Sep 17 00:00:00 2001 From: Enrique Ortiz Date: Sat, 4 Nov 2023 06:48:42 -0400 Subject: [PATCH] feat: revamp readme and release improvements --- .github/scripts/changelog.sh | 12 +++++++++ README.md | 48 +++++++++++++++++++++++++++++++----- release.toml | 13 +++++++--- 3 files changed, 64 insertions(+), 9 deletions(-) create mode 100755 .github/scripts/changelog.sh diff --git a/.github/scripts/changelog.sh b/.github/scripts/changelog.sh new file mode 100755 index 00000000..031fefdd --- /dev/null +++ b/.github/scripts/changelog.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e -o pipefail + +root=$(dirname "$(dirname "$0")") +cmd=(git cliff --workdir "$root" --output "$root/CHANGELOG.md" "$@") + +if [ "$DRY_RUN" = "true" ]; then + echo "skipping due to dry run: ${cmd[*]}" >&2 + exit 0 +else + "${cmd[@]}" +fi diff --git a/README.md b/README.md index a411a586..2726bb20 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,54 @@ -# foundry-compilers +# Foundry Compilers -Utilities for working with native `solc` and compiling projects. +Originally part of [`ethers-rs`] as `ethers-solc`, Foundry Compilers is the compilation backend for [Foundry](https://github.com/foundry-rs/foundry). -To also compile contracts during `cargo build` (so that ethers `abigen!` can pull in updated abi automatically) you can configure a `foundry_compilers::Project` in your `build.rs` file +[`ethers-rs`]'s `ethers-solc` is considered to be in maintenance mode, and any fixes to it will also be reflect on Foundry Compilers. No action is currently needed from devs, although we heavily recommend using Foundry Compilers instead of `ethers-solc`. -First add `foundry-compilers` to your cargo build-dependencies. +[`ethers-rs`]: https://github.com/gakonst/ethers-rs -Once you compiled the project, you can configure cargo change detection with `rerun_if_sources_changed`, so that cargo will execute the `build.rs` file if a contract in the sources directory has changed +[![Build Status][actions-badge]][actions-url] +[![Telegram chat][telegram-badge]][telegram-url] + +[actions-badge]: https://img.shields.io/github/actions/workflow/status/foundry-rs/compilers/ci.yml?branch=main&style=for-the-badge +[actions-url]: https://github.com/foundry-rs/compilers/actions?query=branch%3Amain +[telegram-badge]: https://img.shields.io/endpoint?color=neon&style=for-the-badge&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Ffoundry_rs + +## Supported Rust Versions + + + +Foundry Compilers will keep a rolling MSRV (minimum supported rust version) policy of **at +least** 6 months. When increasing the MSRV, the new Rust version must have been +released at least six months ago. The current MSRV is 1.65.0. + +Note that the MSRV is not increased automatically, and only as part of a minor +release. + +## Contributing + +Thanks for your help improving the project! We are so happy to have you! We have +[a contributing guide](./CONTRIBUTING.md) to help you get involved in the +Foundry Compilers project. + +Pull requests will not be merged unless CI passes, so please ensure that your +contribution follows the linting rules and passes clippy. + +## Overview + +To install, simply add `foundry-compilers` to your cargo dependencies. ```toml -[build-dependencies] +[dependencies] foundry-compilers = { git = "https://github.com/foundry-rs/compilers" } ``` +Example usage: + ```rust use foundry_compilers::{Project, ProjectPathsConfig}; diff --git a/release.toml b/release.toml index 2dfcd4f7..12bd6dc4 100644 --- a/release.toml +++ b/release.toml @@ -1,3 +1,10 @@ -allow-branch = ["master"] -pre-release-commit-message = "chore: release" -tag-message = "chore: release {{crate_name}} v{{version}}" +# Configuration file for [`cargo-release`](https://github.com/crate-ci/cargo-release) +# See: https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md + +allow-branch = ["main"] +sign-commit = true +sign-tag = true +shared-version = true +pre-release-commit-message = "chore: release {{version}}" +tag-prefix = "" # tag only once instead of per every crate +pre-release-hook = ["sh", "-c", "$WORKSPACE_ROOT/scripts/changelog.sh --tag {{version}}"]