From 0dce7565c66e04a959cadea3672adc52c4c188a9 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Thu, 10 Dec 2020 18:00:37 +0000 Subject: [PATCH] Automatically create release tags via GitHub actions Release tags are now created automatically when including an indicator (see updated documentation) in the commit message. For now: keep automated release tagging in dry-run mode (we should first make sure this actually works on this repository before enabling it in production). --- .github/workflows/release-create-tag.yaml | 28 +++++++++++++++++++++++ doc/ADR/release_process.md | 23 ++++++++----------- 2 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/release-create-tag.yaml diff --git a/.github/workflows/release-create-tag.yaml b/.github/workflows/release-create-tag.yaml new file mode 100644 index 00000000000..ddd081d32ef --- /dev/null +++ b/.github/workflows/release-create-tag.yaml @@ -0,0 +1,28 @@ +name: Create release tag +on: + push: + branches: [ develop ] + paths: + - 'src/config.inc' + +jobs: + create-tag: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Get version + run: | + v=$(grep ^CBMC_VERSION src/config.inc | perl -p -e 's/^CBMC_VERSION\s*=\s*//') + echo "CBMC_VERSION=$v" >> $GITHUB_ENV + - name: Set new tag + uses: anothrNick/github-tag-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BRANCHES: develop + CUSTOM_TAG: cbmc-${{ env.CBMC_VERSION }} + VERBOSE: false + DRY_RUN: true diff --git a/doc/ADR/release_process.md b/doc/ADR/release_process.md index 0bfcbbc8270..33718907d9c 100644 --- a/doc/ADR/release_process.md +++ b/doc/ADR/release_process.md @@ -10,23 +10,18 @@ The current process we follow through to make a new release is the following: 1. At the point in time we want to make the release, we make a change to - two files: `src/config.inc`, wherein we update the configuration variable - `CBMC_VERSION`, and `src/libcprover-rust/Cargo.toml`, wherein we update + three files: `src/config.inc`, wherein we update the configuration variable + `CBMC_VERSION`, src/libcprover-rust/Cargo.toml`, wherein we update the `version` variable to be the same as `CBMC_VERSION` (e.g. set both - to `5.80.0`). + to `5.80.0`), and CHANGELOG. - This is important as it informs the various tools of the current version - of CBMC. + This is important as it informs the various tools of the current version of + CBMC. These changes need to be pushed as a PR. Once that PR is merged into + `develop`, a Git tag of the form `cbmc-` (where `` is the + value of `CBMC_VERSION`) is automatically created. This tag then triggers + further automatic steps, see below. - (This needs to be pushed as a PR, and after it gets merged we move on to:) - -2. Then we make a `git tag` out of that commit, and push it to github. The - tag needs to be of the form `cbmc-` with version being a version - number of the form of `x.y.z`, with `x` denoting the major version, `y` - denoting the minor version, and `z` identifying the patch version (useful - for a hotfix or patch.) - -3. Pushing the Rust crate, which is documented [here](https://doc.rust-lang.org/cargo/commands/cargo-publish.html) +2. Pushing the Rust crate, which is documented [here](https://doc.rust-lang.org/cargo/commands/cargo-publish.html) but effectively entails logging in with an API token generated from https://crates.io with `cargo login`, and then issuing `cargo publish`.