1
0
mirror of https://github.com/rtbrick/bngblaster.git synced 2024-05-06 15:54:57 +00:00

94 lines
2.9 KiB
YAML
Raw Normal View History

2021-02-05 00:10:54 +01:00
name: Release
on:
push:
tags:
2021-02-05 16:00:09 +01:00
- "[0-9]+.[0-9]+.[0-9]+"
2021-02-05 00:10:54 +01:00
2021-06-18 10:10:19 +02:00
env:
BUILD_TYPE: Release
2021-02-05 00:10:54 +01:00
jobs:
2021-02-05 16:00:09 +01:00
release:
name: Create Release
2021-02-05 16:06:35 +01:00
runs-on: ubuntu-latest
2021-02-05 16:00:09 +01:00
steps:
2023-04-05 20:09:23 +00:00
- name: Get Ref Names
id: ref_name
run: |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2023-04-05 20:19:28 +00:00
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
2021-02-05 16:00:09 +01:00
with:
2023-04-05 20:19:28 +00:00
tag: ${{ steps.ref_name.outputs.SOURCE_TAG }}
2023-04-05 20:21:46 +00:00
body: "RtBrick BNG Blaster Version ${{ steps.ref_name.outputs.SOURCE_TAG }}"
2021-02-05 16:00:09 +01:00
2021-02-05 00:10:54 +01:00
build:
2021-02-05 16:06:35 +01:00
name: Build Release ${{matrix.os}}
2021-02-05 16:00:09 +01:00
needs: [release]
2021-02-09 22:38:06 +01:00
runs-on: ${{matrix.os}}
2021-02-05 16:00:09 +01:00
strategy:
matrix:
2023-04-05 19:53:05 +00:00
os: [ubuntu-20.04, ubuntu-22.04]
2021-02-05 00:10:54 +01:00
steps:
2022-10-14 18:59:49 +02:00
- uses: actions/checkout@v3
2021-05-26 19:39:12 +02:00
2021-02-05 16:00:09 +01:00
- name: Download RtBrick libdict
2021-02-05 00:10:54 +01:00
shell: bash
2023-08-20 13:22:45 +00:00
run: wget https://github.com/rtbrick/libdict/releases/download/1.0.3/libdict-${{matrix.os}}.zip
2021-05-26 19:39:12 +02:00
2021-02-05 16:00:09 +01:00
- name: Install RtBrick libdict
2021-02-05 00:10:54 +01:00
shell: bash
2023-08-20 13:22:45 +00:00
run: unzip libdict-${{matrix.os}}.zip; sudo dpkg -i libdict_1.0.3_amd64.deb; sudo dpkg -i libdict-dev_1.0.3_amd64.deb
2021-05-26 19:39:12 +02:00
2021-02-05 16:00:09 +01:00
- name: Install Dependencies
2021-02-05 00:10:54 +01:00
shell: bash
run: sudo apt install -y libcunit1-dev libncurses-dev libssl-dev libjansson-dev libcmocka-dev libpcap-dev
2021-02-05 00:10:54 +01:00
2023-04-05 20:09:23 +00:00
- name: Get Ref Names
id: ref_name
run: |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2021-05-26 19:39:12 +02:00
- name: Set export SOURCE_DATE_EPOCH to git commit time
run: |
echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> $GITHUB_ENV
2021-02-05 00:10:54 +01:00
- name: Create Build Environment
2021-02-05 16:06:35 +01:00
run: cmake -E make_directory ${{ github.workspace }}/build
2021-02-05 00:10:54 +01:00
- name: Configure CMake
shell: bash
2021-02-05 16:06:35 +01:00
working-directory: ${{ github.workspace }}/build
2023-04-05 20:09:23 +00:00
run: cmake $GITHUB_WORKSPACE -DBNGBLASTER_VERSION=${{ steps.ref_name.outputs.SOURCE_TAG }} -DBNGBLASTER_TESTS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBNGBLASTER_OS=${{matrix.os}}
2021-02-05 00:10:54 +01:00
- name: Build
2021-02-05 16:06:35 +01:00
working-directory: ${{ github.workspace }}/build
2021-02-05 00:10:54 +01:00
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Test
2021-02-05 16:06:35 +01:00
working-directory: ${{ github.workspace }}/build
2021-02-05 00:10:54 +01:00
shell: bash
run: ctest -C $BUILD_TYPE
- name: Package
working-directory: ${{github.workspace}}/build
shell: bash
2021-02-05 16:00:09 +01:00
run: cpack -G DEB
2021-02-05 00:10:54 +01:00
- name: Upload Debian Package
2023-04-05 19:53:05 +00:00
uses: svenstaro/upload-release-action@v2
2021-02-05 00:10:54 +01:00
with:
2023-04-05 19:53:05 +00:00
repo_token: ${{ secrets.GITHUB_TOKEN }}
2023-04-05 20:09:23 +00:00
file: build/bngblaster_${{ steps.ref_name.outputs.SOURCE_TAG }}_amd64.deb
asset_name: bngblaster-${{ steps.ref_name.outputs.SOURCE_TAG }}-${{ matrix.os }}_amd64.deb
tag: ${{ steps.ref_name.outputs.SOURCE_TAG }}