Release #14
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Existing tag to build a release for (e.g., v0.12.0)' | |
| required: true | |
| default: 'v0.12.0' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macos-arm64: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.tag || github.ref }} | |
| - name: Build | |
| run: | | |
| cmake -B build -DCMAKE_BUILD_TYPE=Release -DTQ_BUILD_SERVER=ON | |
| cmake --build build --config Release -j$(sysctl -n hw.ncpu) | |
| - name: Package | |
| run: | | |
| mkdir -p quant.cpp-macos-arm64 | |
| cp build/quant quant.cpp-macos-arm64/ | |
| cp build/quant-server quant.cpp-macos-arm64/ | |
| cp LICENSE quant.cpp-macos-arm64/ 2>/dev/null || true | |
| cp README.md quant.cpp-macos-arm64/ 2>/dev/null || true | |
| tar czf quant.cpp-macos-arm64.tar.gz quant.cpp-macos-arm64/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: quant.cpp-macos-arm64 | |
| path: quant.cpp-macos-arm64.tar.gz | |
| build-linux-x86_64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.tag || github.ref }} | |
| - name: Build | |
| run: | | |
| cmake -B build -DCMAKE_BUILD_TYPE=Release -DTQ_BUILD_SERVER=ON \ | |
| -DCMAKE_EXE_LINKER_FLAGS="-static -pthread" | |
| cmake --build build --config Release -j$(nproc) | |
| - name: Package | |
| run: | | |
| mkdir -p quant.cpp-linux-x86_64 | |
| cp build/quant quant.cpp-linux-x86_64/ | |
| cp build/quant-server quant.cpp-linux-x86_64/ | |
| cp LICENSE quant.cpp-linux-x86_64/ 2>/dev/null || true | |
| cp README.md quant.cpp-linux-x86_64/ 2>/dev/null || true | |
| tar czf quant.cpp-linux-x86_64.tar.gz quant.cpp-linux-x86_64/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: quant.cpp-linux-x86_64 | |
| path: quant.cpp-linux-x86_64.tar.gz | |
| build-windows-x64: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.tag || github.ref }} | |
| - name: Build | |
| run: | | |
| # Note: TQ_BUILD_SERVER is not enabled on Windows because quant-server | |
| # uses POSIX sockets (sys/socket.h). CMakeLists.txt guards it with | |
| # `if(TQ_BUILD_SERVER AND NOT MSVC)`. Windows users should use the | |
| # Python `quantcpp serve` wrapper instead, or run the server in WSL. | |
| cmake -B build -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build --config Release -j $env:NUMBER_OF_PROCESSORS | |
| - name: Package | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path quant.cpp-windows-x64 | |
| Copy-Item build/Release/quant.exe quant.cpp-windows-x64/ | |
| if (Test-Path LICENSE) { Copy-Item LICENSE quant.cpp-windows-x64/ } | |
| if (Test-Path README.md) { Copy-Item README.md quant.cpp-windows-x64/ } | |
| Compress-Archive -Path quant.cpp-windows-x64/* -DestinationPath quant.cpp-windows-x64.zip | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: quant.cpp-windows-x64 | |
| path: quant.cpp-windows-x64.zip | |
| release: | |
| needs: [build-macos-arm64, build-linux-x86_64, build-windows-x64] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: List artifacts | |
| run: find artifacts -type f | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag || github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| artifacts/quant.cpp-macos-arm64/quant.cpp-macos-arm64.tar.gz | |
| artifacts/quant.cpp-linux-x86_64/quant.cpp-linux-x86_64.tar.gz | |
| artifacts/quant.cpp-windows-x64/quant.cpp-windows-x64.zip |