Merge pull request #341 from bash/flatpak #922
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
SUPPORT_HEIC: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
build_linux: | |
name: Build on linux systems | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-22.04-arm] | |
env: | |
build_dir: "build" | |
config: "Release" | |
CC: gcc | |
CXX: g++ | |
APPIMAGE_EXTRACT_AND_RUN: 1# https://github.com/AppImage/AppImageKit/wiki/FUSE#docker | |
steps: | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y cmake gcc-10 g++-10 libglu1-mesa-dev xorg-dev libdbus-1-dev libwayland-dev wayland-protocols libxkbcommon-dev libffi-dev nasm ninja-build | |
- uses: actions/checkout@v1 | |
with: | |
submodules: recursive | |
- name: CMake | |
run: cmake . -B ${{ env.build_dir }} -GNinja -DCMAKE_BUILD_TYPE=${{ env.config }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} | |
- name: Build | |
working-directory: ${{ env.build_dir }} | |
run: cmake --build . --target all --verbose -j | |
- name: Package | |
working-directory: ${{ env.build_dir }} | |
run: cmake --build . --config ${{ env.config }} --target package --verbose | |
- name: Upload executable | |
if: github.event_name != 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Linux executable (${{ matrix.os }}) | |
path: ${{ env.build_dir }}/tev.appimage | |
build_macos: | |
name: Build on macOS | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- arch: x86_64 | |
# The macos-13 runner uses Intel machines, see | |
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories | |
os: macos-13 | |
- arch: arm64 | |
# The latest macos runners use arm machines. Picking runners like this avoids fringe issues with cross-compilation. | |
os: macos-latest | |
env: | |
build_dir: "build" | |
config: "Release" | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: brew install nasm | |
- name: Remove pre-installed dependencies that conlict with our build | |
run: brew uninstall --ignore-dependencies jpeg-xl || echo "jpeg-xl not installed, continuing" | |
- name: CMake | |
run: cmake . -B ${{ env.build_dir }} -GNinja -DCMAKE_BUILD_TYPE=${{ env.config }} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} | |
- name: Build | |
working-directory: ${{ env.build_dir }} | |
run: cmake --build . --config ${{ env.config }} --target all --verbose -j | |
- name: Zip app | |
working-directory: ${{ env.build_dir }} | |
run: zip -r tev.app.zip tev.app | |
- name: Upload executable | |
if: github.event_name != 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macOS executable (${{ matrix.arch }}) | |
path: ${{ env.build_dir }}/tev.app.zip | |
build_windows: | |
name: Build on Windows | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- windows-2022 | |
# CMake is currently borked on the ARM runner, detecting AMD64. Disable for now. | |
# https://github.com/orgs/community/discussions/155713#discussioncomment-12991583 | |
# - windows-11-arm | |
env: | |
build_dir: "build" | |
config: "Release" | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
choco install nasm | |
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: CMake | |
run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} | |
- name: Build | |
working-directory: ${{ env.build_dir }} | |
run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose | |
- name: Create installer | |
working-directory: ${{ env.build_dir }} | |
run: cpack | |
- name: Upload executable | |
if: github.event_name != 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows executable (${{ matrix.os }}) | |
path: ${{ env.build_dir }}/${{ env.config }}/tev.exe | |
- name: Upload installer | |
if: github.event_name != 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows installer (${{ matrix.os }}) | |
path: ${{ env.build_dir }}/tev-installer.msi |