Skip to content

Build

Build #308

Workflow file for this run

name: Build
on:
push:
branches:
- master
tags:
- "*"
pull_request:
schedule:
# Every week
- cron: "0 0 * * 0"
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-13, macos-14]
include:
- platform: ubuntu-latest
configure_preset: "static"
build_preset: "static-release"
release_name: "linux-x86-64"
cc: "gcc-14"
cxx: "g++-14"
- platform: windows-latest
configure_preset: "windows-static"
build_preset: "windows-static-release"
release_name: "windows-x64"
- platform: macos-13
configure_preset: "macos"
build_preset: "macos-release"
release_name: "macos-x64"
cc: "/usr/local/opt/llvm/bin/clang"
cxx: "/usr/local/opt/llvm/bin/clang++"
- platform: macos-14
configure_preset: "macos"
build_preset: "macos-release"
release_name: "macos-arm64"
cc: "/opt/homebrew/opt/llvm/bin/clang"
cxx: "/opt/homebrew/opt/llvm/bin/clang++"
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: lukka/get-cmake@latest
- name: Run vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: "vcpkg.json"
- name: Install requirements
run: |
# Temporary until gcc-14 is officialy released and available on the runner
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ noble main universe"
sudo apt update
sudo apt install gcc-14 g++-14
sudo apt install libfuse-dev
if: matrix.platform == 'ubuntu-latest'
- name: Brew python fix
run: |
# Temporary fix, see https://github.com/actions/setup-python/issues/577
rm /usr/local/bin/2to3 || true
rm /usr/local/bin/idle3 || true
rm /usr/local/bin/pydoc3 || true
rm /usr/local/bin/python3 || true
rm /usr/local/bin/python3-config || true
shell: bash
if: matrix.platform == 'macos-13'
- name: Install requirements (MacOS)
run: |
brew update
brew install llvm
brew install macfuse
# Hack to properly target the os libcxx dynlib
sed -i '' '/^#define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS/d' "$(brew --prefix llvm)"/include/c++/v1/__config_site
echo "CXXFLAGS=-mmacos-version-min=13.3" >> $GITHUB_ENV
shell: bash
if: matrix.platform == 'macos-13' || matrix.platform == 'macos-14'
- name: Set compiler
run: |
echo "CC=${{matrix.cc}}" >> $GITHUB_ENV
echo "CXX=${{matrix.cxx}}" >> $GITHUB_ENV
shell: bash
if: matrix.cc != ''
- name: Build
uses: lukka/run-cmake@v10
with:
configurePreset: ${{matrix.configure_preset}}
buildPreset: ${{matrix.build_preset}}
- name: Strip binaries
run: |
strip build/${{matrix.configure_preset}}/wfs-extract/Release/wfs-extract
strip build/${{matrix.configure_preset}}/wfs-file-injector/Release/wfs-file-injector
strip build/${{matrix.configure_preset}}/wfs-fuse/Release/wfs-fuse
strip build/${{matrix.configure_preset}}/wfs-info/Release/wfs-info
strip build/${{matrix.configure_preset}}/wfs-reencryptor/Release/wfs-reencryptor
shell: bash
if: matrix.platform != 'windows-latest'
- name: Upload wfs-extract
uses: actions/upload-artifact@v4
with:
name: wfs-extract-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-extract/Release
- name: Upload wfs-file-injector
uses: actions/upload-artifact@v4
with:
name: wfs-file-injector-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-file-injector/Release
- name: Upload wfs-fuse
uses: actions/upload-artifact@v4
with:
name: wfs-fuse-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-fuse/Release
if: matrix.platform != 'windows-latest'
- name: Upload wfs-info
uses: actions/upload-artifact@v4
with:
name: wfs-info-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-info/Release
- name: Upload wfs-reencryptor
uses: actions/upload-artifact@v4
with:
name: wfs-reencryptor-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-reencryptor/Release
- name: Prepare Release Windows
run: powershell Compress-Archive -Path build\${{matrix.configure_preset}}\wfs-file-injector\Release\wfs-file-injector.exe, build\${{matrix.configure_preset}}\wfs-extract\Release\wfs-extract.exe, build\${{matrix.configure_preset}}\wfs-info\Release\wfs-info.exe, build\${{matrix.configure_preset}}\wfs-reencryptor\Release\wfs-reencryptor.exe -DestinationPath wfs-tools-${{github.ref_name}}-${{matrix.release_name}}.zip
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && matrix.platform == 'windows-latest'
- name: Prepare Release Linux & MacOS
run: zip -r -j wfs-tools-${{github.ref_name}}-${{matrix.release_name}}.zip build/${{matrix.configure_preset}}/wfs-file-injector/Release/wfs-file-injector build/${{matrix.configure_preset}}/wfs-extract/Release/wfs-extract build/${{matrix.configure_preset}}/wfs-fuse/Release/wfs-fuse build/${{matrix.configure_preset}}/wfs-info/Release/wfs-info build/${{matrix.configure_preset}}/wfs-reencryptor/Release/wfs-reencryptor
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && matrix.platform != 'windows-latest'
- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
with:
files: wfs-tools-${{github.ref_name}}-${{matrix.release_name}}.zip