opt9: batch vle processing (#228) #591
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
create_release: | |
name: build deb | |
runs-on: ubuntu-latest | |
container: debian:buster | |
steps: | |
- name: Install git | |
run: | | |
apt-get update && apt-get install -y git | |
- name: Checkout code | |
uses: actions/checkout@master | |
with: | |
submodules: true | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@latest | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: | | |
Release ${{ github.ref }} | |
draft: true | |
prerelease: false | |
- name: Build for Debian | |
id: build_debian | |
run: | | |
apt-get update && apt-get install -y gcc-7 g++-7 libzmq3-dev cmake build-essential clang-format | |
mkdir build | |
cd build | |
cmake -D CMAKE_C_COMPILER=gcc-7 -D CMAKE_CXX_COMPILER=g++-7 -D CMAKE_BUILD_TYPE=Release .. | |
cpack | |
echo "::set-output name=deb_path::$(realpath ursadb*.deb | head -n 1)" | |
echo "::set-output name=deb_name::$(realpath ursadb*.deb | head -n 1 | rev | cut -f1 -d/ | rev)" | |
- name: Test package install | |
id: test_package_deb | |
run: | | |
dpkg -i build/ursadb*.deb | |
ursadb_new /tmp/test.ursa | |
ursadb | grep -q Usage | |
ursacli -h 2<&1 | grep -q Usage | |
- name: Upload Debian package | |
id: upload_release_deb | |
uses: actions/upload-release-asset@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.build_debian.outputs.deb_path }} | |
asset_name: ${{ steps.build_debian.outputs.deb_name }} | |
asset_content_type: application/vnd.debian.binary-package |