Skip to content

Build (Linux)

Build (Linux) #38

Workflow file for this run

#
# Stripped down version of the official hackrf workflow.
#
name: Build (Linux)
on:
push:
pull_request:
workflow_dispatch:
# Run automatically every monday
schedule:
- cron: 1 12 * * 1
jobs:
build_linux:
strategy:
matrix:
os: ['ubuntu-latest']
# Don't cancel all builds when one fails
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
run: |
sudo apt update
sudo apt install libfftw3-dev libhackrf-dev libczmq-dev libzmq5 libzmq3-dev libmsgpack-dev
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE/ -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config Release
- name: Install
working-directory: ${{github.workspace}}/build
run: |
sudo cmake --install . --config Release --prefix=$GITHUB_WORKSPACE/install
- name: List install directory
run: ls -lhRt install/
# Publish the contents of install/
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: hackrf_sweeper-ubuntu
path: ${{github.workspace}}/install/*
release:
runs-on: ubuntu-latest
needs: build_linux
steps:
- name: Set Date for Release
run: echo "RELEASE_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Download build artifacts (jars)
uses: actions/download-artifact@v4
with:
name: hackrf_sweeper-ubuntu
path: hackrf_sweeper-ubuntu-${{ env.RELEASE_DATE }}
# Create a tarball of the entire directory structure
- name: Create Tarball of Artifacts
run: |
tar -czvf hackrf_sweeper-ubuntu-${{ env.RELEASE_DATE }}.tar.gz hackrf_sweeper-ubuntu-${{ env.RELEASE_DATE }}
- name: List current working directory
run: ls -lhRt
- name: Create GitHub Release for Stable Tags
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-stable')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Stable Release - ${{ github.ref_name }} - ${{ env.RELEASE_DATE }} (Ubuntu)
draft: false
prerelease: false
generate_release_notes: true
files: hackrf_sweeper-ubuntu-${{ env.RELEASE_DATE }}.tar.gz
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}