1
0
mirror of https://github.com/rtbrick/bngblaster.git synced 2024-05-06 15:54:57 +00:00
Christian Giese 83e1a4f0c6 Release Actions
2021-02-05 16:00:09 +01:00

86 lines
2.4 KiB
YAML

name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
name: Create Release
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Release ${{ github.ref }}
draft: true # need to manually publish
prerelease: false
build:
name: Build Release
needs: [release]
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Download RtBrick libdict
shell: bash
run: wget https://github.com/rtbrick/libdict/releases/download/v1.0.1/libdict-debian.zip
- name: Install RtBrick libdict
shell: bash
run: unzip libdict-debian.zip; sudo dpkg -i libdict_1.0.1_amd64.deb; sudo dpkg -i libdict-dev_1.0.1_amd64.deb
- name: Install Dependencies
shell: bash
run: sudo apt install -y libcunit1-dev libncurses5-dev libssl-dev libjansson-dev libcmocka-dev libpcap-dev
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DBNGBLASTER_VERSION=${{ github.ref }} -DBNGBLASTER_TESTS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -C $BUILD_TYPE
- name: Package
working-directory: ${{github.workspace}}/build
shell: bash
run: cpack -G DEB
- name: Get Release
uses: pdamianik/release-tag-to-upload-url-action@v1.0.1
with:
tag: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Debian Package
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.uploadUrl }}
asset_path: build/bngblaster_${{ github.ref }}_amd64.deb
asset_name: bngblaster-${{matrix.os}-${{ github.ref }}_amd64.deb