Build nfd libraries #3
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: Build nfd libraries | |
on: [workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
arch: x86_64 | |
cmake-arch: x64 | |
vcpkg-triplet: x64-linux | |
- os: windows-latest | |
arch: x86_64 | |
cmake-arch: x64 | |
vcpkg-triplet: x64-windows-static | |
- os: windows-latest | |
arch: x86 | |
cmake-arch: win32 | |
vcpkg-triplet: x86-windows-static | |
- os: macos-latest | |
arch: x86_64 | |
cmake-arch: x86_64 | |
vcpkg-triplet: x64-osx | |
- os: macos-latest | |
arch: arm64 | |
cmake-arch: arm64 | |
vcpkg-triplet: arm64-osx | |
steps: | |
- uses: actions/[email protected] | |
with: | |
repository: 'btzy/nativefiledialog-extended' | |
path: 'nativefiledialog-extended' | |
submodules: false | |
- name: Install dependencies on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake libgtk-3-dev | |
- name: Configure nfd with CMake on Linux (x86_64) | |
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64' | |
run: | | |
cd nativefiledialog-extended | |
mkdir build | |
cd build | |
cmake -DNFD_BUILD_TESTS=OFF -DNFD_INSTALL=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. | |
- name: Configure nfd with CMake for macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
cd nativefiledialog-extended | |
mkdir build | |
cd build | |
cmake -DNFD_BUILD_TESTS=OFF -DNFD_INSTALL=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake-arch }} .. | |
- name: Configure nfd with CMake for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
cd nativefiledialog-extended | |
mkdir build | |
cd build | |
cmake -A ${{ matrix.cmake-arch }} -DNFD_BUILD_TESTS=OFF -DNFD_INSTALL=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake-arch }} .. | |
- name: Build nfd | |
run: | | |
cmake --build nativefiledialog-extended/build --config Release | |
echo "Contents of build directory:" | |
ls -R nativefiledialog-extended/build | |
- name: Upload Artifacts | |
uses: actions/[email protected] | |
with: | |
name: nfd-${{ matrix.os }}-${{ matrix.arch }}-artifacts | |
path: | | |
nativefiledialog-extended/build/src/Release/*.dll | |
nativefiledialog-extended/build/src/Release/*.so | |
nativefiledialog-extended/build/src/Release/*.dylib | |
if-no-files-found: warn # 'warn' or 'ignore' or 'error' |