Enable linux debug preset #178
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
name: CMake | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
release: | |
types: [ published ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
strategy: | |
matrix: | |
config: | |
- { os: windows-latest, preset: windows-x64-release, vcpkg-dir: 'C:/lukka-vcpkg' } | |
- { os: ubuntu-20.04, preset: linux-x64-debug, vcpkg-dir: '/tmp/lukka-vcpkg' } | |
- { os: macos-latest, preset: macos-x64-release, vcpkg-dir: '/tmp/lukka-vcpkg' } | |
runs-on: ${{ matrix.config.os }} | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
# TODO: figure out how to disable wxGL so we can get rid of freeglut | |
- run: sudo apt-get update && sudo apt-get install pkg-config libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev freeglut3-dev | |
if: ${{ contains(matrix.config.os, 'ubuntu') }} | |
- run: brew install pkg-config | |
if: ${{ contains(matrix.config.os, 'macos') }} | |
- run: mkdir ${{ matrix.config.vcpkg-dir }} | |
# Install latest CMake. | |
- uses: lukka/get-cmake@latest | |
- name: Restore artifacts, or setup vcpkg (do not install any package) | |
uses: lukka/run-vcpkg@v10 | |
with: | |
vcpkgDirectory: ${{ matrix.config.vcpkg-dir }} | |
# 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: 'c168ce4e765409509c9c482faa0468c4e1ab386b' | |
# 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 | |
- name: Run CMake consuming CMakePreset.json and vcpkg.json by mean of vcpkg. | |
uses: lukka/run-cmake@v10 | |
with: | |
# This is the default path to the CMakeLists.txt along side the | |
# CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json | |
# located elsewhere. | |
# cmakeListsTxtPath: 'C:/snfm/CMakeLists.txt' | |
# This is the name of the CMakePresets.json's configuration to use to generate | |
# the project files. This configuration leverages the vcpkg.cmake toolchain file to | |
# run vcpkg and install all dependencies specified in vcpkg.json. | |
configurePreset: '${{ matrix.config.preset }}' | |
# This is the name of the CMakePresets.json's configuration to build the project. | |
buildPreset: '${{ matrix.config.preset }}' | |
- name: Remove buildtrees from cache | |
uses: JesseTG/[email protected] | |
with: | |
path: ${{ matrix.config.vcpkg-dir }}/buildtrees | |
- name: Remove downloads from cache | |
uses: JesseTG/[email protected] | |
with: | |
path: ${{ matrix.config.vcpkg-dir }}/downloads | |
- name: Archive build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: snfm-${{ matrix.config.preset }} | |
path: | | |
out/build/${{ matrix.config.preset }}/manage_files.exe | |
out/build/${{ matrix.config.preset }}/send_file.exe | |
out/build/${{ matrix.config.preset }}/manage_files | |
out/build/${{ matrix.config.preset }}/send_file | |
out/build/${{ matrix.config.preset }}/snfm_user_manual.md | |
out/build/${{ matrix.config.preset }}/snfm_config_example.yaml | |
- run: | | |
echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV | |
if: ${{ failure() || cancelled() }} | |
shell: bash | |
release: | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Inject slug/short variables | |
uses: rlespinasse/[email protected] | |
- name: Get artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: snfm-windows-x64-release | |
path: windows | |
- name: Get artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: snfm-linux-x64-release | |
path: linux | |
- name: Get artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: snfm-macos-x64-release | |
path: macos | |
- name: Fix +x | |
run: | | |
chmod +x linux/send_file | |
chmod +x linux/manage_files | |
chmod +x macos/send_file | |
chmod +x macos/manage_files | |
- name: Archive Release | |
uses: thedoctor0/zip-release@main | |
with: | |
type: zip | |
filename: ../snfm-windows-x64-release.zip | |
directory: windows | |
- name: Archive Release | |
uses: thedoctor0/zip-release@main | |
with: | |
type: zip | |
filename: ../snfm-linux-x64-release.zip | |
directory: linux | |
- name: Archive Release | |
uses: thedoctor0/zip-release@main | |
with: | |
type: zip | |
filename: ../snfm-macos-x64-release.zip | |
directory: macos | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: ${{ env.GITHUB_REF_SLUG }} | |
overwrite: true | |
asset_name: snfm-$tag-windows-x64.zip | |
file: snfm-windows-x64-release.zip | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: ${{ env.GITHUB_REF_SLUG }} | |
overwrite: true | |
asset_name: snfm-$tag-linux-x64.zip | |
file: snfm-linux-x64-release.zip | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: ${{ env.GITHUB_REF_SLUG }} | |
overwrite: true | |
asset_name: snfm-$tag-macos-x64.zip | |
file: snfm-macos-x64-release.zip |