Skip to content

Commit

Permalink
Merge pull request #536 from diffblue/ebmc-release-flow
Browse files Browse the repository at this point in the history
CI: add release flow for Debian 22.04 binaries
  • Loading branch information
tautschnig authored Jun 10, 2024
2 parents 8c12e38 + 72c1a77 commit 05fecdd
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/ebmc-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
on:
release:
types: [created]

name: Upload additional release assets
jobs:
ubuntu-22_04-package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq gcc g++ jq flex bison libxml2-utils ccache
- name: Prepare ccache
uses: actions/cache@v4
with:
save-always: true
path: .ccache
key: ${{ runner.os }}-20.04-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
${{ runner.os }}-20.04-make-gcc-${{ github.ref }}
${{ runner.os }}-20.04-make-gcc
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Get minisat
run: make -C lib/cbmc/src minisat2-download
- name: Build with make
run: make -C src -j2 CXX="ccache g++"
- name: Run the ebmc tests with SAT
run: make -C regression/ebmc test
- name: Run the verilog tests
run: make -C regression/verilog test
- name: Print ccache stats
run: ccache -s
- name: Create packages
id: create_packages
run: |
VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)
mkdir -p ebmc-${VERSION}/DEBIAN
mkdir -p ebmc-${VERSION}/usr/bin
cp src/ebmc/ebmc ebmc-${VERSION}/usr/bin
cat << EOM > ebmc-${VERSION}/DEBIAN/control
Package: ebmc
Version: ${VERSION}
Architecture: amd64
Maintainer: Daniel Kroening <[email protected]>
Depends:
Installed-Size: 6600
Homepage: http://www.cprover.org/ebmc/
Description: The EBMC Model Checker
EOM
chown root:root -R ebmc-${VERSION}
dpkg -b ebmc-${VERSION}
deb_package_name="$(ls *.deb)"
echo "deb_package=./build/$deb_package_name" >> $GITHUB_OUTPUT
echo "deb_package_name=ubuntu-22.04-$deb_package_name" >> $GITHUB_OUTPUT
- name: Get release info
id: get_release_info
uses: bruceadams/[email protected]
- name: Upload binary packages
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ steps.create_packages.outputs.deb_package }}
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
asset_content_type: application/x-deb
51 changes: 51 additions & 0 deletions .github/workflows/ebmc-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
push:
tags:
- 'ebmc-*'

name: Create Release

jobs:
get-version-information:
name: Get Version Information
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.split-version.outputs._1 }}
steps:
- uses: jungwinter/split@v2
id: split
with:
msg: ${{ github.ref }}
seperator: '/'
- uses: jungwinter/split@v2
id: split-version
with:
msg: ${{ steps.split.outputs._2 }}
seperator: '-'
perform-release:
name: Perform Release
runs-on: ubuntu-20.04
needs: get-version-information
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create release
uses: actions/create-release@v1
env:
EBMC_VERSION: ${{ needs.get-version-information.outputs.version }}
with:
tag_name: ebmc-${{ env.EBMC_VERSION }}
release_name: ebmc-${{ env.EBMC_VERSION }}
draft: false
prerelease: false
body: |
This is EBMC version ${{ env.EBMC_VERSION }}.
## Ubuntu
On Ubuntu, install EBMC by downloading the *.deb package below for your version of Ubuntu and install with
```sh
# Ubuntu 22:
$ dpkg -i ubuntu-22.04-ebmc-${{ env.EBMC_VERSION }}-Linux.deb
```

0 comments on commit 05fecdd

Please sign in to comment.