Skip to content

Build AppImage based on conda packages #674

Build AppImage based on conda packages

Build AppImage based on conda packages #674

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
appimage:
name: AppImage
runs-on: ubuntu-latest
steps:
- name: Install base dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libegl1
- name: Install conda dependencies
id: setup-micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: gqrx
create-args: >-
c-compiler
cxx-compiler
cmake
make
pkg-config
boost-cpp
gnuradio-core
gnuradio-osmosdr
mesa-libgl-devel-cos6-x86_64
pybind11
pulseaudio
qt-gtk-platformtheme
qt-main
soapysdr-module-lms7
soapysdr-module-netsdr
soapysdr-module-plutosdr
soapysdr-module-remote
volk
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure
shell: bash -el {0}
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
- name: Compile
shell: bash -el {0}
working-directory: build
run: |
make -j4
make install
- name: Build AppImage
shell: bash -el {0}
env:
APPIMAGE_EXTRACT_AND_RUN: "1"
PREFIX: ${{ steps.setup-micromamba.outputs.environment-path }}
run: ./appimage.sh
- name: Save artifact
uses: actions/upload-artifact@v3
with:
name: gqrx-appimage-${{ github.run_id }}
path: Gqrx-*.AppImage
macos:
name: MacOS
runs-on: macos-11
steps:
- name: Install dependencies
run: |
brew update
brew install --HEAD librtlsdr
brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf libserialport portaudio pybind11 uhd qt@6 || true
brew tap pothosware/homebrew-pothos
brew install soapyremote
cd /tmp
git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
git checkout v0.23
mkdir build
cd build
cmake ..
make -j4
sudo make install
cd /tmp
git clone https://github.com/analogdevicesinc/libad9361-iio.git
cd libad9361-iio
mkdir build
cd build
cmake ..
make -j4
sudo make install
cd /tmp
git clone https://github.com/pothosware/SoapyPlutoSDR.git
cd SoapyPlutoSDR
mkdir build
cd build
cmake ..
make -j4
make install
cd /tmp
cp /Library/Frameworks/iio.framework/iio /usr/local/lib/libiio.dylib
install_name_tool -id "/usr/local/lib/libiio.dylib" /usr/local/lib/libiio.dylib
cp /Library/Frameworks/ad9361.framework/ad9361 /usr/local/lib/libad9361.dylib
install_name_tool -id "/usr/local/lib/libad9361.dylib" /usr/local/lib/libad9361.dylib
install_name_tool -delete_rpath /Library/Frameworks /usr/local/lib/libad9361.dylib
install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/libad9361.dylib
install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
install_name_tool -change @rpath/ad9361.framework/Versions/0.2/ad9361 /usr/local/lib/libad9361.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
cd /tmp
git clone https://gitea.osmocom.org/sdr/gr-iqbal.git
cd gr-iqbal
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make -j4
make install
cd /tmp
git clone https://github.com/gqrx-sdr/gr-osmosdr.git
cd gr-osmosdr
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS=-Wno-register ..
LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4
make install
- name: Install Apple certificate
if: github.event_name != 'pull_request'
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure
run: mkdir build && cd build && cmake ..
- name: Compile
working-directory: build
run: make -j4
- name: Build app bundle
run: ./macos_bundle.sh
- name: Notarize app bundle
if: github.event_name != 'pull_request'
env:
NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }}
NOTARIZE_TEAM_ID: ${{ secrets.NOTARIZE_TEAM_ID }}
NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }}
run: |
ditto -c -k --keepParent Gqrx.app Gqrx.zip
xcrun notarytool submit Gqrx.zip --apple-id "$NOTARIZE_USERNAME" --team-id "$NOTARIZE_TEAM_ID" --password "$NOTARIZE_PASSWORD" --wait
- name: Staple app bundle
if: github.event_name != 'pull_request'
run: xcrun stapler staple --verbose Gqrx.app
- name: Create DMG
run: hdiutil create Gqrx.dmg -srcfolder Gqrx.app -format UDZO -fs HFS+ -volname Gqrx
- name: Notarize DMG
if: github.event_name != 'pull_request'
env:
NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }}
NOTARIZE_TEAM_ID: ${{ secrets.NOTARIZE_TEAM_ID }}
NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }}
run: |
xcrun notarytool submit Gqrx.dmg --apple-id "$NOTARIZE_USERNAME" --team-id "$NOTARIZE_TEAM_ID" --password "$NOTARIZE_PASSWORD" --wait
- name: Staple DMG
if: github.event_name != 'pull_request'
run: xcrun stapler staple --verbose Gqrx.dmg
- name: Rename DMG
run: |
GQRX_VERSION=$(<version.txt)
mv Gqrx.dmg Gqrx-$GQRX_VERSION.dmg
- name: Save artifact
uses: actions/upload-artifact@v3
with:
name: gqrx-macos-${{ github.run_id }}
path: Gqrx-*.dmg