Skip to content

Commit

Permalink
Automatically create release tags via GitHub actions
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
tautschnig committed Aug 23, 2024
1 parent 6752c40 commit 0dce756
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release-create-tag.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 9 additions & 14 deletions doc/ADR/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<version>` (where `<version>` 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-<version>` 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`.

Expand Down

0 comments on commit 0dce756

Please sign in to comment.