Set CI to run every Monday, configured artifacts for all platforms. #33
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
# | |
# 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: Download build artifacts (jars) | |
uses: actions/download-artifact@v4 | |
with: | |
name: hackrf_sweeper-ubuntu | |
- name: List current working directory | |
run: ls -lhRt | |
- name: Set Date for Nightly Release | |
run: echo "RELEASE_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- 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: unused | |
fail_on_unmatched_files: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |