Build #455
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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "*" | |
| pull_request: | |
| schedule: | |
| # Every week | |
| - cron: "0 0 * * 0" | |
| env: | |
| LLVM_VERSION: 19 | |
| GCC_VERSION: 14 | |
| 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-$GCC_VERSION" | |
| cxx: "g++-$GCC_VERSION" | |
| - 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: | | |
| sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ noble main universe" | |
| sudo apt update | |
| sudo apt install gcc-$GCC_VERSION g++-$GCC_VERSION | |
| sudo apt install libfuse-dev | |
| if: matrix.platform == 'ubuntu-latest' | |
| - name: Brew python fix | |
| run: | | |
| # Temporary fix, see https://github.com/actions/runner-images/issues/9966 | |
| brew install --overwrite python@3.12 | |
| brew install --overwrite python@3.13 | |
| shell: bash | |
| if: matrix.platform == 'macos-13' | |
| - name: Install requirements (MacOS) | |
| run: | | |
| brew update | |
| brew install llvm@$LLVM_VERSION | |
| 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.4" >> $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@v2 | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: wfs-tools-${{github.ref_name}}-${{matrix.release_name}}.zip |