Bezier patches can be copy pasted #24
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
on: | |
# Run on pushes to tags, the "master" branch, and PR's | |
push: | |
tags: | |
- '**' | |
branches: | |
- master | |
pull_request: | |
name: CI | |
jobs: | |
# Job key | |
ci: | |
# Label displayed in UI | |
name: CI | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Don't cancel the macOS build if the Linux build fails, etc. | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04, macos-11, windows-2019] | |
tb-build-type: [release] | |
tb-arch: [default-arch] | |
exclude: | |
- os: windows-2019 | |
tb-arch: default-arch | |
include: | |
- os: macos-11 | |
tb-build-type: asan | |
- os: windows-2019 | |
tb-arch: x64 | |
- os: windows-2019 | |
tb-arch: Win32 | |
env: | |
# Record pull request head commit SHA | |
TB_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
TB_OS_IMAGE: ${{ matrix.os }} | |
steps: | |
# See: https://github.com/actions/checkout | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
# Dependencies | |
- name: Install common Linux dependencies | |
if: ${{ startsWith(matrix.os, 'ubuntu-') }} | |
run: | | |
sudo apt update | |
sudo apt install build-essential libxi-dev libxrandr-dev libxxf86vm-dev freeglut3-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libglm-dev pandoc cmake p7zip-full ninja-build xvfb libglew-dev libfreeimage-dev libfreetype6-dev libtinyxml2-dev libassimp-dev | |
- name: Install Qt5 on Ubuntu 22.04 | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
sudo apt update | |
sudo apt install qtbase5-dev libqt5svg5-dev | |
- name: Install Qt5 on Ubuntu 20.04 | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: | | |
sudo apt update | |
sudo apt install qt5-default libqt5svg5-dev | |
- name: Install Pandoc (Windows) | |
if: ${{ matrix.os == 'windows-2019' }} | |
run: | | |
# Chocolatey was taking 3 minutes to install pandoc; just install it directly | |
Invoke-WebRequest 'https://github.com/jgm/pandoc/releases/download/2.11.3.1/pandoc-2.11.3.1-windows-x86_64.zip' -OutFile 'pandoc.zip' | |
if ("668A62A8990DEB2753753DF0C8D3F1BE567026FE" -ne (Get-FileHash -Path 'pandoc.zip' -Algorithm SHA1).Hash) { exit } | |
7z x pandoc.zip -o'.' | |
$tb_pandoc_path = "$(pwd)\pandoc-2.11.3.1" | |
# Add this to the system path | |
echo "Pandoc path: $tb_pandoc_path" | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files | |
echo "$tb_pandoc_path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Install Qt on Windows (x64) | |
if: ${{ matrix.os == 'windows-2019' && matrix.tb-arch == 'x64' }} | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '5.15.2' | |
arch: 'win64_msvc2019_64' | |
- name: Install Qt on Windows (Win32) | |
if: ${{ matrix.os == 'windows-2019' && matrix.tb-arch == 'Win32' }} | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '5.15.2' | |
arch: 'win32_msvc2019' | |
- name: Install macOS dependencies | |
if: ${{ matrix.os == 'macos-11' }} | |
run: | | |
brew install cmake p7zip pandoc qt5 ninja autoconf automake | |
# Restore from cache the previously built ports. If a "cache miss" occurs, | |
# then vcpkg is bootstrapped. Since a the vcpkg.json is being used later on | |
# to install the packages when `run-cmake` runs, no packages are installed at | |
# this time. | |
- name: Restore artifacts or setup vcpkg (do not install any package) | |
uses: lukka/run-vcpkg@v10 | |
with: | |
# This is the default location of the directory containing vcpkg sources. | |
# Change it to the right location if needed. | |
# vcpkgDirectory: '${{ github.workspace }}/vcpkg' | |
# If not using a submodule for vcpkg sources, this specifies which commit | |
# id must be checkout from a Git repo. It must not set if using a submodule | |
# for vcpkg. | |
# vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}' | |
# This is the glob expression used to locate the vcpkg.json and add its | |
# hash to the cache key. Change it to match a single manifest file you want | |
# to use. | |
vcpkgJsonGlob: 'vcpkg.json' | |
# This is needed to run `vcpkg install` command (after vcpkg is built) in | |
# the directory where vcpkg.json has been located. Default is false, | |
# It is highly suggested to let `run-cmake` to run vcpkg (i.e. `false`) | |
# (i.e. let CMake run `vcpkg install`) using the vcpkg.cmake toolchain. | |
# runVcpkgInstall: 'true' | |
# Run build script | |
- name: Linux build | |
if: ${{ startsWith(matrix.os, 'ubuntu-') }} | |
run: ./CI-linux.sh | |
- name: macOS build | |
if: ${{ matrix.os == 'macos-11' }} | |
run: | | |
if [ '${{ matrix.tb-build-type }}' = 'asan' ]; then | |
export TB_DEBUG_BUILD=true | |
fi | |
./CI-macos.sh | |
- name: Windows build | |
if: ${{ matrix.os == 'windows-2019' }} | |
# NOTE: docs at https://github.com/jurplel/install-qt-action | |
# mention that it sets a Qt5_DIR environment variable. | |
# Our script expects it in QT5_INSTALL_DIR | |
# NOTE: cmd.exe /c = run a command and terminate | |
run: | | |
$Env:QT5_INSTALL_DIR = $env:Qt5_DIR | |
cmd.exe /c CI-windows.bat | |
env: | |
TB_ARCH: ${{ matrix.tb-arch }} | |
# Upload artifacts. | |
# These need to be separate, otherwise all of the artifacts are bundled into | |
# one .zip file. | |
# win64 | |
- name: Upload win64 artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.os == 'windows-2019' && matrix.tb-arch == 'x64' }} | |
with: | |
name: win64 | |
path: | | |
cmakebuild/*.7z | |
cmakebuild/*.7z.md5 | |
# win32 | |
- name: Upload win32 artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.os == 'windows-2019' && matrix.tb-arch == 'Win32' }} | |
with: | |
name: win32 | |
path: | | |
cmakebuild/*.7z | |
cmakebuild/*.7z.md5 | |
# Linux | |
- name: Upload Linux artifacts | |
uses: actions/upload-artifact@v3 | |
if: ${{ startsWith(matrix.os, 'ubuntu-') }} | |
with: | |
name: linux | |
path: | | |
build/*.deb | |
build/*.md5 | |
# macOS | |
- name: Upload macOS artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.os == 'macos-11' && matrix.tb-build-type != 'asan' }} | |
with: | |
name: macos | |
path: | | |
build/*.dmg | |
build/*.md5 | |
# Create release | |
# Official action upload-release-asset doesn't support uploading files | |
# based on a glob, so use https://github.com/softprops/action-gh-release | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.tb-build-type != 'asan' }} | |
with: | |
draft: true | |
files: | | |
build/*.deb | |
build/*.dmg | |
build/*.md5 | |
cmakebuild/*.7z | |
cmakebuild/*.7z.md5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload compiled manual | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-20.04' }} | |
with: | |
# I've created a SSH key pair following https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-create-ssh-deploy-key | |
# The TrenchBroom/TrenchBroom repo has a repository secret ACTIONS_DEPLOY_KEY set to the SSH private key | |
# The TrenchBroom/manual repo has a deploy key set to the SSH public key | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: TrenchBroom/manual # Repo to deploy to | |
publish_branch: gh-pages # Branch to deploy to | |
publish_dir: ./build/app/gen-manual # Source directory tree | |
destination_dir: latest # Deploy to this directory in target repo |