From 72c1a77ff7e2b074b21ca358c6fc6c2e64687b05 Mon Sep 17 00:00:00 2001 From: Daniel Kroening Date: Sun, 9 Jun 2024 18:41:08 -0700 Subject: [PATCH] CI: add release flow for Debian 22.04 binaries --- .github/workflows/ebmc-packages.yaml | 71 ++++++++++++++++++++++++++++ .github/workflows/ebmc-release.yaml | 51 ++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 .github/workflows/ebmc-packages.yaml create mode 100644 .github/workflows/ebmc-release.yaml diff --git a/.github/workflows/ebmc-packages.yaml b/.github/workflows/ebmc-packages.yaml new file mode 100644 index 000000000..6566996e1 --- /dev/null +++ b/.github/workflows/ebmc-packages.yaml @@ -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 + 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/get-release@v1.3.2 + - 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 diff --git a/.github/workflows/ebmc-release.yaml b/.github/workflows/ebmc-release.yaml new file mode 100644 index 000000000..822d0e893 --- /dev/null +++ b/.github/workflows/ebmc-release.yaml @@ -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 + ```