Skip to content

Commit

Permalink
add packaging workflow, remove some cmake messages
Browse files Browse the repository at this point in the history
  • Loading branch information
scottwittenburg committed Dec 4, 2023
1 parent d30e2dc commit 9ffd7e4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 4 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/pypackaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Python Packaging

on:
workflow_dispatch:
pull_request:
# push:
# branches:
# - main
release:
types:
- published

jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

build_wheels:
name: Wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- uses: pypa/cibuildwheel@v2.16
env:
CIBW_BUILD: cp*-manylinux_x86_64

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl

upload_all:
needs: [build_wheels, make_sdist]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

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

4 changes: 0 additions & 4 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ endfunction()
# Extract the common prefix from a collection of variables
function(lists_get_prefix listVars outVar)
foreach(l IN LISTS listVars)
message(" l: ${l}")
foreach(d IN LISTS ${l})
message(" d: ${d}")
if(NOT prefix)
set(prefix "${d}")
continue()
Expand All @@ -66,7 +64,6 @@ function(lists_get_prefix listVars outVar)
endif()
endforeach()
endforeach()
message("setting ${outVar} = ${prefix} in the PARENT_SCOPE")
set(${outVar} "${prefix}" PARENT_SCOPE)
endfunction()

Expand Down Expand Up @@ -433,7 +430,6 @@ if(Python_Interpreter_FOUND)
else()
lists_get_prefix("Python_EXECUTABLE;Python_SITEARCH" _Python_DEVPREFIX)
endif()
message("This is borked! _Python_DEVPREFIX = ${_Python_DEVPREFIX}, Python_SITEARCH = ${Python_SITEARCH}")
string_strip_prefix(
"${_Python_DEVPREFIX}" "${Python_SITEARCH}" CMAKE_INSTALL_PYTHONDIR_DEFAULT
)
Expand Down

0 comments on commit 9ffd7e4

Please sign in to comment.