Skip to content

[build] general build alignment between XCSoar and OpenSoar #146

[build] general build alignment between XCSoar and OpenSoar

[build] general build alignment between XCSoar and OpenSoar #146

Workflow file for this run

---
on:
workflow_dispatch:
push:
paths-ignore:
- 'cloud/**'
- 'doc/**'
- 'fuzzer/**'
- 'ide/**'
- 'kobo/**'
- 'python/**'
- '.github/workflows/build-container.yml'
- '.github/workflows/build-unix.yml'
branches:
- master
- dev-branch
pull_request:
paths-ignore:
- 'cloud/**'
- 'doc/**'
- 'fuzzer/**'
- 'ide/**'
- 'kobo/**'
- 'python/**'
- '.github/workflows/build-container.yml'
- '.github/workflows/build-unix.yml'
branches:
- master
- dev-branch
env:
DEBUG: y
BOOST: boost_1_84_0
jobs:
build-windows:
runs-on: ubuntu-22.04
env:
TARGET: WIN64
TARGET_BIN: OpenSoar
TARGET_FINAL: OpenSoar-debug
TARGET_EXT: .exe
steps:
- name: set vars for push
if: github.event_name == 'push'
run: |
echo "DEBUG=n" >> $GITHUB_ENV
echo "TARGET_FINAL=OpenSoar" >> $GITHUB_ENV
- id: checkout
uses: actions/checkout@v3
with:
submodules: true
- id: cache-ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ env.TARGET }}
- name: "Cache Boost"
uses: actions/cache@v3
with:
key: ${{ env.BOOST }}-${{ hashFiles('lib/boost/patches/**') }}
path: |
${{ github.workspace }}/output/download/${{ env.BOOST }}.tar.bz2
${{ github.workspace }}/output/src/stamp-${{ env.BOOST }}
${{ github.workspace }}/output/src/${{ env.BOOST }}/boost
- name: "Cache third-party libraries"
uses: actions/cache@v3
with:
key: ${{ runner.os }}-libs-${{ env.TARGET }}-${{ hashFiles('build/**') }}
path: |
${{ github.workspace }}/output/${{ env.TARGET }}/lib
!${{ github.workspace }}/output/${{ env.TARGET }}/lib/build
- name: find githash
run: |
echo "git_hash=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
make \
quilt \
g++ \
g++-mingw-w64 \
python3 \
librsvg2-bin xsltproc \
imagemagick gettext sox \
cmake ninja-build
- name: Compile OpenSoar
run: |
make -j$(nproc) TARGET=${{env.TARGET }} DEBUG=${{ env.DEBUG }} USE_CCACHE=y V=2 everything
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.TARGET_FINAL }}-${{ env.git_hash }}${{ env.TARGET_EXT }}
path: output/${{ env.TARGET }}/bin/${{ env.TARGET_BIN }}${{ env.TARGET_EXT }}
- name: store checks and compile artefacts
uses: actions/upload-artifact@v3
with:
name: opensoar-${{ env.TARGET }}-artifact
path: |
${{ github.workspace }}/output/${{ env.TARGET }}
!${{ github.workspace }}/output/${{ env.TARGET }}/lib/build
!**.d
retention-days: 1
- name: Deploy to Staging server
if: |
github.repository == 'OpenSoaring/OpenSoar' &&
github.ref == 'ref/head/master' &&
github.event == 'push'
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.REPOSITORY_SSH_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: output/${{ env.TARGET }}/bin/${{ env.TARGET_BIN }}.${{ env.TARGET_EXT }}
REMOTE_HOST: ${{ secrets.REPOSITORY_HOST }}
REMOTE_USER: ${{ secrets.REPOSITORY_SSH_USER }}
TARGET: ${{ secrets.REPOSITORY_REMOTE_PATH }}/testing/${{ env.TARGET }}/