name: Build QGC and upload to release on: [push, pull_request] defaults: run: shell: bash env: JOBS: 4 CONFIG: installer ACTIONS_BUILD_DIR: ${{ github.workspace }}/../qgroundcontrol jobs: build-job: runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] gst_version: ["1.18.1"] #Only running MacOS right now, but we leave this options #for future builds of all distros exclude: - os: ubuntu-latest - os: windows-latest steps: - name: Checkout repo uses: actions/checkout@v2 with: submodules: recursive - name: Cache uses: actions/cache@v2 id: cache with: path: ~/.ccache key: ${{ runner.os }}-mac-ccache-${{ github.sha }} restore-keys: | ${{ runner.os }}-mac-ccache-${{ github.sha }} ${{ runner.os }}-mac-ccache- - name: Install ccache run: | brew install ccache - name: install QT via action uses: jurplel/install-qt-action@v2 with: version: '5.12.6' host: 'mac' target: 'desktop' dir: '${{ runner.temp }}' modules: 'qtcharts' setup-python: 'false' - name: Install Gstreamer run: | GST_URL_BASE_PATH="https://gstreamer.freedesktop.org/data/pkg/osx/${{ matrix.gst_version }}" wget "${GST_URL_BASE_PATH}/gstreamer-1.0-devel-${{ matrix.gst_version }}-x86_64.pkg" wget "${GST_URL_BASE_PATH}/gstreamer-1.0-${{ matrix.gst_version }}-x86_64.pkg" for package in *.pkg ; do sudo installer -verbose -pkg "$package" -target / done - name: mkdir directory shadow_build run: mkdir ${{ runner.temp }}/shadow_build_dir - name: run qmake and build working-directory: ${{ runner.temp }}/shadow_build_dir run: | export JOBS=$((`sysctl -n hw.ncpu`+1)) export LIBRARY_PATH=/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/ export CCACHE_DIR=~/.ccache ccache -s ccache -z qmake -r ${ACTIONS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=ccache make -j$JOBS ccache -s - uses: actions/upload-artifact@master with: name: QGroundControl.dmg path: ${{ runner.temp }}/shadow_build_dir/package/QGroundControl.dmg - name: Upload build artifacts to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ runner.temp }}/shadow_build_dir/package/QGroundControl.dmg asset_name: QGroundControl.dmg tag: ${{ github.ref }} overwrite: true body: "QGroundControl ${{ steps.get_version.outputs.VERSION }} test"