Build (OS X) #30
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: Build (OS X) | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: 1 12 * * 1 | |
jobs: | |
build_osx: | |
strategy: | |
# Don't cancel all builds when one fails | |
fail-fast: false | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies (macOS) | |
run: brew install fftw | |
- name: List available FFTW (macOS) | |
run: brew list fftw --verbose | |
- name: Clone libhackrf | |
uses: actions/checkout@v4 | |
with: | |
repository: greatscottgadgets/hackrf | |
path: hackrf | |
# Build libhackrf ONLY | |
- name: Create Build Environment (libhackrf) | |
run: | | |
cd hackrf | |
cmake -E make_directory ${{github.workspace}}/hackrf/host/libhackrf/build | |
echo "HACKRF_HOME=$PWD" >> $GITHUB_ENV | |
- name: Configure CMake (libhackrf) | |
working-directory: ${{github.workspace}}/hackrf/host/libhackrf/build | |
run: cmake $GITHUB_WORKSPACE/hackrf/host/libhackrf/ -DCMAKE_BUILD_TYPE=Release | |
- name: Build (libhackrf) | |
working-directory: ${{github.workspace}}/hackrf/host/libhackrf/build | |
run: cmake --build . --config Release | |
- name: Install (libhackrf) | |
working-directory: ${{github.workspace}}/hackrf/host/libhackrf/build | |
run: | | |
sudo cmake --install . --config Release --prefix=$GITHUB_WORKSPACE/install | |
echo "HACKRF_INSTALL_DIR=$GITHUB_WORKSPACE/install" >> $GITHUB_ENV | |
- 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 -DLIBHACKRF_DIR=$HACKRF_INSTALL_DIR -DLIBHACKRF_LIBRARIES=$HACKRF_INSTALL_DIR/lib/libhackrf.dylib -DLIBHACKRF_INCLUDE_DIR=$HACKRF_INSTALL_DIR/include/libhackrf | |
- 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-osx | |
path: ${{github.workspace}}/install/* | |
release: | |
runs-on: ubuntu-latest | |
needs: build_osx | |
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-osx | |
path: hackrf_sweeper-osx-${{ env.RELEASE_DATE }} | |
# Create a tarball of the entire directory structure | |
- name: Create Tarball of Artifacts | |
run: | | |
tar -czvf hackrf_sweeper-osx-${{ env.RELEASE_DATE }}.tar.gz hackrf_sweeper-osx-${{ 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 }} (OS X) | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
files: hackrf_sweeper-osx-${{ env.RELEASE_DATE }}.tar.gz | |
fail_on_unmatched_files: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |