Skip to content

CI: add release flow for Debian 22.04 binaries #536

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

Merged
merged 1 commit into from
Jun 10, 2024
Merged
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
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
```