diff --git a/.github/ISSUE_TEMPLATE/minor_release.md b/.github/ISSUE_TEMPLATE/minor_release.md deleted file mode 100644 index feb0f64d..00000000 --- a/.github/ISSUE_TEMPLATE/minor_release.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -name: Minor Release -about: Create a new minor release [for release managers only] -title: 'Release MAJOR.MINOR+1.0' -labels: 'release' -assignees: '' - ---- - -## Create a new minor release - -### Summary - -<--release summary to be used in announcements--> - -### Commit - -<--latest commit ID to include in this release--> - -### Changelog - -<--add notices from PRs merged since the prior release, see ["keep a changelog"]--> - -### Checklist - -Release numbering must follow [Semantic Versioning]. These steps assume the current `master` -branch **development** version is *MAJOR.MINOR.0*. - -#### On the day of the feature freeze - -Change the `master` branch to the next MINOR+1 version: - -- [ ] Switch to the `master` branch. -- [ ] Create a new PR branch called `bump_dev_MAJOR_MINOR+1`, eg. `bump_dev_0_22`. -- [ ] Bump the `bump_dev_MAJOR_MINOR+1` branch to the next development MINOR+1 version. - - Change the `Cargo.toml` version value to `MAJOR.MINOR+1.0`. - - The commit message should be "Bump version to MAJOR.MINOR+1.0". -- [ ] Create PR and merge the `bump_dev_MAJOR_MINOR+1` branch to `master`. - - Title PR "Bump version to MAJOR.MINOR+1.0". - -#### On the day of the release - -Tag and publish new release: - -- [ ] Double check that your local `master` is up-to-date with the upstream repo. -- [ ] Create a new branch called `release/MAJOR.MINOR+1` from `master`. -- [ ] Add a tag to the `HEAD` commit in the `release/MAJOR.MINOR+1` branch. - - The tag name should be `vMAJOR.MINOR+1.0` - - The first line of the tag message should be "Release MAJOR.MINOR+1.0". - - In the body of the tag message put a copy of the **Summary** and **Changelog** for the release. - - Make sure the tag is signed, for extra safety use the explicit `--sign` flag. -- [ ] Wait for the CI to finish one last time. -- [ ] Push the new tag to the `bitcoindevkit/bdk-cli` repo. -- [ ] Publish **all** the updated crates to crates.io. -- [ ] Create the release on GitHub. - - Go to "tags", click on the dots on the right and select "Create Release". - - Set the title to `Release MAJOR.MINOR+1.0`. - - In the release notes body put the **Summary** and **Changelog**. - - Use the "+ Auto-generate release notes" button to add details from included PRs. - - Until we reach a `1.0.0` release check the "Pre-release" box. -- [ ] Make sure the new release shows up on [crates.io] and that the docs are built correctly on [docs.rs]. -- [ ] Announce the release, using the **Summary**, on Discord, Twitter and Mastodon. -- [ ] Celebrate 🎉 - -[Semantic Versioning]: https://semver.org/ -[crates.io]: https://crates.io/crates/bdk-cli -[docs.rs]: https://docs.rs/bdk-cli/latest/bdk-cli -["keep a changelog"]: https://keepachangelog.com/en/1.0.0/ diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index fe8a5a4e..ca298a07 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,11 +9,6 @@ -## Changelog notice - - - - ### Checklists #### All Submissions: @@ -26,10 +21,8 @@ of the PR were done in a specific way --> * [ ] I've added tests for the new feature * [ ] I've added docs for the new feature -* [ ] I've updated `CHANGELOG.md` #### Bugfixes: -* [ ] This pull request breaks the existing API * [ ] I've added tests to reproduce the issue which are now passing * [ ] I'm linking the issue being fixed by this PR diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 93806d53..607d2d6c 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -13,7 +13,7 @@ jobs: security_audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: actions-rust-lang/audit@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 013d43e9..55e9dfdb 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -13,11 +13,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: persist-credentials: false - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v2 with: toolchain: stable components: llvm-tools-preview @@ -32,7 +32,7 @@ jobs: - name: Check lcov.info run: cat ./coverage/lcov.info - name: Upload to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} files: ./coverage/lcov.info diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 727f042b..cf299408 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -21,9 +21,9 @@ jobs: - --all-features steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Setup Rust Toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v2 with: toolchain: ${{ matrix.rust }} profile: minimal @@ -44,10 +44,10 @@ jobs: - --all-features steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v2 with: toolchain: stable profile: minimal @@ -97,9 +97,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Setup Rust Toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v2 with: toolchain: stable profile: minimal diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 00000000..c4f6258f --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,116 @@ +name: Release-plz + +# How this works (see https://release-plz.dev/docs/github/quickstart): +# +# This workflow is triggered manually only (Actions -> "Release-plz" -> "Run +# workflow"). Select the branch to release from in the "Use workflow from" +# dropdown (e.g. the default branch or `release/1.x`) and click "Run workflow". +# Both jobs below run on every dispatch: +# +# 1. The `release-pr` job opens/updates a release PR (branch prefix `release-plz-`) +# with the version bump and changelog for updated crates, targeting the +# selected branch, authored by the `bitcoindevkit-release-plz` GitHub App. +# The version bump for each crate is computed from that branch's Cargo.toml. +# Re-run it to refresh the release PR after new commits land on the branch. +# 2. The `release` job checks whether the release PR has been merged. If so, it +# publishes the crate to crates.io (via trusted publishing / OIDC, no token +# secret) and creates the `vX.Y.Z` git tag and GitHub release. +# The job runs in the `release` GitHub environment, whose required reviewers +# are defined in the GitHub repository config; publishing waits until an +# authorized GitHub user approves it in the Actions UI. +# +# Notes: +# - release-plz supports only one open release PR per repository, so don't +# prepare releases on two branches concurrently. + +on: + workflow_dispatch: + +permissions: {} + +jobs: + # Create or update the PR with the new version and changelog. + release-pr: + name: Create/Update Rust Release PR + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'bitcoindevkit' }} + permissions: + contents: write # push the release PR branch + pull-requests: write # open and update the release PR + concurrency: + group: release-plz-${{ github.ref_name }} + cancel-in-progress: false + steps: + - name: Validate selected branch + env: + BRANCH: ${{ github.ref_name }} + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + run: | + case "$BRANCH" in + "$DEFAULT_BRANCH"|release/*) ;; + *) echo "Refusing to release from '$BRANCH' (expected '$DEFAULT_BRANCH' or 'release/*')"; exit 1 ;; + esac + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.RELEASE_PLZ_APP_ID }} + private-key: ${{ secrets.RELEASE_PLZ_PRIVATE_KEY }} + - name: Checkout repository + uses: actions/checkout@v7 + with: + ref: ${{ github.ref_name }} + fetch-depth: 0 + persist-credentials: false + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v2 + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} + + # If the release PR was merged, publish to crates.io, tag, and create the + # GitHub release. Gated by the `release` environment (team approval). + release: + name: Publish Rust Release + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'bitcoindevkit' }} + environment: release + permissions: + contents: write # push tags and create GitHub releases + pull-requests: read # detect the merged release PR + id-token: write # crates.io trusted publishing (OIDC) + steps: + - name: Validate selected branch + env: + BRANCH: ${{ github.ref_name }} + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + run: | + case "$BRANCH" in + "$DEFAULT_BRANCH"|release/*) ;; + *) echo "Refusing to release from '$BRANCH' (expected '$DEFAULT_BRANCH' or 'release/*')"; exit 1 ;; + esac + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.RELEASE_PLZ_APP_ID }} + private-key: ${{ secrets.RELEASE_PLZ_PRIVATE_KEY }} + - name: Checkout repository + uses: actions/checkout@v7 + with: + ref: ${{ github.ref_name }} + fetch-depth: 0 + persist-credentials: false + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v2 + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} + # No CARGO_REGISTRY_TOKEN on purpose: crates.io trusted publishing is + # configured for this repo + workflow + the `release` environment. diff --git a/DEVELOPMENT_CYCLE.md b/DEVELOPMENT_CYCLE.md index 11e7a268..c394068f 100644 --- a/DEVELOPMENT_CYCLE.md +++ b/DEVELOPMENT_CYCLE.md @@ -10,7 +10,7 @@ Once the project reaches a more mature state (>= `1.0.0`), we will very likely s The "feature freeze" will happen **one week before the release date**. This means a new branch will be created originating from the `master` tip at that time, and in that branch we will stop adding new features and only focus on ensuring the ones we've added are working properly. -To create a new release a release manager will create a new issue using the `Release` template and follow the template instructions. +To create a new release a release manager will trigger the `release-plz` workflow to create a new release PR, review and approve it, and then trigger the `release-plz` workflow again to publish it to `crates.io`. [used by the Rust language]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html [Semantic Versioning]: https://semver.org/