Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.8.0 #17

Merged
merged 14 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 0 additions & 166 deletions .github/workflows/build_test_wheels.yml

This file was deleted.

131 changes: 126 additions & 5 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,130 @@
name: build and upload wheels

# Currently we aim to test building python wheels for all pushes to feature and release branches
# HOWEVER we only want to upload these wheels to testpypi for release candidates, which are considered
# to be pushes to a release branch or to develop.
# finally, we only push tagged releases to pypi proper. Note that only a subset of platforms are considered
# for test builds and the full suite (including longer-running builds) is only run on pushes to tags.
# This is controlled using conditional statements for individual jobs and steps in this script.
on:
push:
tags:
- '*'
branches:
- release/*
- feature/*
- main
- develop

jobs:
build_wheels:
name: build wheels on ${{matrix.build-platform[0]}} ${{matrix.build-platform[1]}}
name: build ${{matrix.build-platform[2]}} wheels on ${{matrix.build-platform[0]}} ${{matrix.build-platform[1]}}
runs-on: ${{matrix.build-platform[0]}}
strategy:
fail-fast: false
matrix:
build-platform:
# ubuntu/aarch64 emulation and manylinux2014 are both slow running builds
# which are only executed on push to tag.
# Test wheels are also generated for the other platforms (and uploaded to testpypi)
# on pushes to release branches and to main
- [ubuntu-latest, x86_64, manylinux2014_x86_64]
- [ubuntu-latest, x86_64, manylinux_2_28_x86_64]
- [ubuntu-latest,aarch64,manylinux_2_28_aarch64]
- [ubuntu-latest, aarch64, manylinux_2_28_aarch64]
- [macos-13, x86_64, macosx_x86_64]
- [macos-14, arm64, macosx_arm64]
- [windows-latest, AMD64, win_amd64]

steps:
- uses: actions/checkout@v3
# need git tags available for setuptools_scm to grab tags? will elad to slower checkout
# need git tags available for setuptools_scm to grab tags
with:
fetch-depth: 0

- uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: install windows deps
if: runner.os == 'Windows'
run: >
vcpkg install --triplet x64-windows-static-md --binarysource="clear;x-gha,readwrite"
libxml2
capnproto
boost-program-options
boost-format
boost-algorithm
boost-multi-array
openssl
dlfcn-win32
spdlog

- name: build uda on windows
if: runner.os == 'Windows'
env:
XDR_ROOT: extlib/install
CMAKE_PREFIX_PATH: C:/vcpkg/installed/x64-windows-static-md
Boost_DIR: C:/vcpkg/installed/x64-windows-static-md/share/boost
LibXml2_DIR: C:/vcpkg/installed/x64-windows-static-md/share/libxml2
CapnProto_DIR: C:/vcpkg/installed/x64-windows-static-md/share/capnproto
fmt_DIR: C:/vcpkg/installed/x64-windows-static-md/share/fmt
run: >
cmake -Bextlib/build ./extlib
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-DVCPKG_TARGET_TRIPLET="x64-windows-static-md"
-DVCPKG_HOST_TRIPLET="x64-windows-static-md"
-DCMAKE_GENERATOR_PLATFORM=x64
-DBUILD_SHARED_LIBS=OFF
&& cmake --build extlib/build --config Release
&& cmake --install extlib/build --prefix extlib/install
&& cmake -Bbuild .
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-DVCPKG_TARGET_TRIPLET="x64-windows-static-md"
-DVCPKG_HOST_TRIPLET="x64-windows-static-md"
-DCMAKE_GENERATOR_PLATFORM=x64
-DBUILD_SHARED_LIBS=ON
-DSSLAUTHENTICATION=ON
-DCLIENT_ONLY=ON
-DENABLE_CAPNP=ON
-DNO_JAVA_WRAPPER=ON
-DNO_CXX_WRAPPER=ON
-DNO_IDL_WRAPPER=ON
-DNO_CLI=ON
-DNO_MEMCACHE=ON
-DCMAKE_INSTALL_PREFIX=install
&& cmake --build build -j --config Release
&& cmake --install build --config Release
&& ls install/lib
&& cat install/python_installer/setup.py

- name: build windows wheels
if: runner.OS == 'Windows'
uses: pypa/cibuildwheel@v2.17.0
with:
package-dir: ${{github.workspace}}/install/python_installer
config-file: ${{github.workspace}}/install/python_installer/pyproject.toml
env:
CIBW_ARCHS: ${{matrix.build-platform[1]}}
CIBW_PLATFORM: windows
CIBW_BUILD: cp3*-${{matrix.build-platform[2]}}
CIBW_SKIP: cp36* cp37*
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel} --add-path ${{github.workspace}}/install/lib"
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"

- name: Build manylinux2014 wheels
if: startswith(matrix.build-platform[2], 'manylinux2014')
# this is a slow-running build. Only execute on tag
if: >
startswith(matrix.build-platform[2], 'manylinux2014') &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/')
uses: pypa/cibuildwheel@v2.17.0
with:
package-dir: ./source/wrappers/python
Expand Down Expand Up @@ -79,7 +171,11 @@ jobs:
cp -r /usr/local/python_installer/* /project/source/wrappers/python/

- name: Build manylinux_2_28 wheels
if: startswith(matrix.build-platform[2], 'manylinux_2_28')
# hardware emulation for ubuntu on arm64 archiecture is much slower. Do not run that case except for push to tag.
if: >
startswith(matrix.build-platform[2], 'manylinux_2_28') &&
! ( startswith(matrix.build-platform[1], 'aarch64') &&
!startsWith(github.ref, 'refs/tags/') )
uses: pypa/cibuildwheel@v2.17.0
with:
package-dir: ./source/wrappers/python
Expand Down Expand Up @@ -145,6 +241,8 @@ jobs:
path: ./wheelhouse/*.whl

upload_pypi:
# only upload to pypi for tagged releases
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: build_wheels
runs-on: ubuntu-latest
environment:
Expand All @@ -161,3 +259,26 @@ jobs:
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1

upload_test_pypi:
# push test wheels to testpypi for all intermediate release candidates (release/*, develop, etc.)
# but never for feature branches
if: >
github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/feature/')
needs: build_wheels
runs-on: ubuntu-latest
environment:
name: testpypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
20 changes: 11 additions & 9 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ jobs:
build:
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
release: [Release]
ssl: [ON, OFF]
client-only: [OFF]
client-only: [ON, OFF]
capnp: [ON, OFF]
# include:
# - client-only: ON
# ssl: OFF
# - client-only: OFF
# ssl: OFF
exclude:
- os: windows-latest
client-only: OFF
- os: ubuntu-latest
client-only: ON
- os: macos-latest
client-only: ON

runs-on: ${{ matrix.os }}

Expand All @@ -39,7 +40,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
Expand Down Expand Up @@ -169,6 +170,7 @@ jobs:
-DSSLAUTHENTICATION=${{ matrix.ssl }}
-DCLIENT_ONLY=${{ matrix.client-only }}
-DENABLE_CAPNP=${{ matrix.capnp }}
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/uda_install

- name: Build
run: cmake --build build --config ${{ matrix.release }}
Expand Down
Loading
Loading