4.0.2 #10
Workflow file for this run
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 release binaries | |
on: | |
release: | |
types: [published] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | |
# You can convert this to a matrix build if you need cross-platform coverage. | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
archs: "x86_64" | |
- os: windows-2019 | |
archs: "AMD64" | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Install Python dependencies | |
run: python -m pip install numpy>=1.16 six setuptools | |
- name: Setup CMake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.22.x' | |
- uses: actions/checkout@v4 | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON -DBUILD_CLIENT=ON -DBUILD_PYTHON=ON -DBUILD_PLATFORM="${{env.RUNNER_OS}}_${{env.RUNNER_ARCH}}" | |
- name: Compile | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure | |
- name: Build ZIP package | |
working-directory: ${{github.workspace}}/build | |
run: cpack -C ${{env.BUILD_TYPE}} --config CPackConfig.cmake | |
- name: Build Python source package | |
working-directory: ${{github.workspace}}/build/python | |
run: python setup.py sdist | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: "${{ matrix.archs }}" | |
CIBW_BUILD: "cp311-* pp310-*" | |
with: | |
package-dir: ${{github.workspace}}/build/python | |
output-dir: ${{github.workspace}}/build/python/dist | |
#- name: Build Python wheels | |
# working-directory: ${{github.workspace}}/build/python | |
# run: python -m cibuildwheel --output-dir dist | |
- name: Upload ZIP artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ !env.ACT }} | |
with: | |
name: zip-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ${{github.workspace}}/build/trax*.zip | |
- name: Upload wheel artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ !env.ACT }} | |
with: | |
name: wheel-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ${{github.workspace}}/build/python/dist/*.* | |
- name: Copy artifacts to output directory | |
if: ${{ env.ACT }} | |
run: | | |
mkdir -p /output | |
cp ${{github.workspace}}/build/python/dist/*.* /output/ | |
cp ${{github.workspace}}/build/*.zip /output/ | |
publish-pypi: | |
runs-on: ubuntu-20.04 | |
needs: build | |
environment: | |
name: pypi | |
url: https://pypi.org/p/vot-trax | |
permissions: | |
id-token: write | |
steps: | |
- name: Get artifacts from build job | |
uses: actions/download-artifact@v4 | |
if: ${{ !env.ACT }} | |
with: | |
pattern: wheel-* | |
merge-multiple: true | |
path: ${{github.workspace}}/pypi/ | |
- name: Publish package to PyPI using OCID | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: ${{ !env.ACT }} | |
with: | |
packages-dir: ${{github.workspace}}/pypi/ | |
publish-github: | |
runs-on: ubuntu-20.04 | |
needs: build | |
environment: | |
name: github | |
url: | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Get artifacts from build job | |
uses: actions/download-artifact@v4 | |
if: ${{ !env.ACT }} | |
with: | |
pattern: zip-* | |
merge-multiple: true | |
path: ${{github.workspace}}/zip | |
- name: Upload binaries to release using OCID | |
uses: softprops/action-gh-release@v1 | |
if: ${{ !env.ACT }} | |
with: | |
files: ${{github.workspace}}/zip/*.zip | |
token: ${{ secrets.GITHUB_TOKEN }} |