Skip to content

Automatically produce a CBMC release twice per month #8425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
70 changes: 70 additions & 0 deletions .github/workflows/release-timetabled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release on 14th and 28th of each month

on:
schedule:
- cron: "0 8 */14 * *" # Run this on 14th and 28th of each month at 08:00
workflow_dispatch: # Allow manual dispatching for a release at a custom point in time.

permissions:
checks: write
contents: write
pull-requests: write

jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Compare CBMC versions and determine next step
env:
GH_TOKEN: ${{ github.token }}
run: |
latest_release=$(gh -R diffblue/cbmc release list | grep Latest | awk '{print $3}' | cut -f2 -d-)
latest_release_sha=$(git ls-remote origin cbmc-$latest_release | awk '{print $1}')
head_sha=$(git ls-remote origin refs/heads/develop | awk '{ print $1 }')
echo "head_sha=$head_sha" >> $GITHUB_ENV
if [ x$latest_release_sha = x$head_sha ] ; then
# no changes since latest release
echo "next_step=none" >> $GITHUB_ENV
else
# create a draft release to construct release notes
gh release create cbmc-DRAFT --draft --generate-notes
gh release view cbmc-DRAFT --json body --jq '.body' > CHANGELOG.new
gh release delete -y cbmc-DRAFT
# compute the new version
latest_major=$(echo $latest_release | cut -f1 -d.)
latest_minor=$(echo $latest_release | cut -f2 -d.)
next_minor=$(($latest_minor + 1))
next_version="$latest_major.$next_minor.0"
echo "next_version=$next_version" >> $GITHUB_ENV
# produce an updated CHANGELOG
echo "# CBMC $next_version" > CHANGELOG.tmp
echo >> CHANGELOG.tmp
cat -s CHANGELOG.new >> CHANGELOG.tmp
rm CHANGELOG.new
cho >> CHANGELOG.tmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo?

cat CHANGELOG >> CHANGELOG.tmp
mv CHANGELOG.tmp CHANGELOG
# update version strings in source tree
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TO be clear, this is only in specific config files, not the whole "source tree"

perl -p -i -e \
"s/^CBMC_VERSION\s*=\s*\Q$latest_release\E/CBMC_VERSION = $next_version/" \
src/config.inc
perl -p -i -e \
"s/^version\s*=\s*\"\Q$latest_release\E\"/version = \"$next_version\"/" \
src/libcprover-rust/Cargo.toml
# debug logging of changes
git diff
echo "next_step=create_pr" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: ${{ env.next_step == 'create_pr' }}
uses: peter-evans/create-pull-request@v6
with:
commit-message: Release CBMC ${{ env.next_version }}
branch: cbmc-${{ env.next_version }}
delete-branch: true
title: 'Automatic release of CBMC ${{ env.next_version }}'
body: >
Release CBMC ${{ env.next_version }} up to the changes in ${{ env.head_sha }}.
3 changes: 2 additions & 1 deletion doc/ADR/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ anything more, but the process is described below for reference:
## Versioning

We adopt an approach approximating SemVer. That is, our version numbers should
be major.minor.patch. Regular releases (as of 2022-06-23: every other week)
be major.minor.patch. Regular releases (as of 2024-08-23: every 14th and 28th of
each month)
should normally increment the minor version number. This is also where we can
deprecate undesired features, i.e., mark as deprecated, warn existing users.

Expand Down
Loading