-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Including automagically build and upload to pypi upon release. Also use tbump to increment version and date in CITATION.cff
- Loading branch information
Showing
6 changed files
with
213 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: Build Wheels | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
jobs: | ||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Deps | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libcfitsio-dev python-is-python3 libboost-python-dev ninja-build | ||
curl -L https://github.com/icecube/photospline/archive/refs/tags/v2.2.1.tar.gz | tar xz | ||
cmake -S photospline-2.2.1 -B photospline -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr | ||
sudo make install -C photospline | ||
- uses: actions/checkout@v4 | ||
- name: Build sdist | ||
run: pipx run build --sdist | ||
- name: Test sdist | ||
run: | | ||
python -m pip install meson pytest pytest-subtests | ||
python -m pip install dist/nuflux-*.tar.gz | ||
python tests/test_fluxes.py | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/nuflux-*.tar.gz | ||
build_wheels: | ||
name: Build wheels cp${{ matrix.python }}-manylinux_x86_64 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python: ["37","38","39","310","311","312"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp${{ matrix.python }}-manylinux_x86_64 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-cp${{ matrix.python }} | ||
path: ./wheelhouse/*.whl | ||
test_wheels: | ||
name: Test Wheel with Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
needs: build_wheels | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Download wheel | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifact | ||
- name: Display structure of downloaded files | ||
run: | | ||
PYNAME=$(echo cp${{matrix.python-version}} | sed 's/\.//') | ||
FNAME=artifact/cibw-wheels-${PYNAME}/nuflux-*-${PYNAME}-*.whl | ||
python3 -m pip install pytest pytest-subtests $FNAME | ||
- uses: actions/checkout@v4 | ||
- name: Test | ||
working-directory: tests | ||
run: ./test_fluxes.py | ||
cvmfs_test_wheel: | ||
name: Test Wheel with cvmfs ${{matrix.cvmfs}} | ||
needs: build_wheels | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
cvmfs: [py3-v4.1.1, py3-v4.2.1, py3-v4.3.0] | ||
include: | ||
- cvmfs: py3-v4.1.1 | ||
python-tag: cp37 | ||
- cvmfs: py3-v4.2.1 | ||
python-tag: cp310 | ||
- cvmfs: py3-v4.3.0 | ||
python-tag: cp311 | ||
steps: | ||
- uses: cvmfs-contrib/github-action-cvmfs@v3 | ||
- name: Checkout nuflux | ||
uses: actions/checkout@v2 | ||
- name: Download wheel | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-wheels-${{ matrix.python-tag }} | ||
merge-multiple: true | ||
- name: Build and Run Tests in Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
options: -v /cvmfs/icecube.opensciencegrid.org/:/cvmfs/icecube.opensciencegrid.org/ -v /home/runner/work/nuflux/nuflux:/nuflux | ||
image: centos:centos7.9.2009 | ||
run: | | ||
eval $(/cvmfs/icecube.opensciencegrid.org/${{matrix.cvmfs}}/setup.sh) | ||
python3 -m pip install --user pytest pytest-subtests /nuflux/nuflux-*-${{matrix.python-tag}}-*.whl | ||
python3 /nuflux/tests/test_fluxes.py | ||
upload_pypi: | ||
needs: [cvmfs_test_wheel,test_wheels,build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,3 +128,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
#cibuildwheel | ||
/wheelhouse/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# run with: | ||
# docker build -t kjmeagher/nuflux-manylinux2014_x86_64 - < manylinux2014.Dockerfile | ||
# python -m cibuildwheel --platform linux | ||
# docker push kjmeagher/nuflux-manylinux2014_x86_64 | ||
FROM quay.io/pypa/manylinux2014_x86_64:latest | ||
|
||
WORKDIR / | ||
RUN curl -L https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2 | tar xj | ||
WORKDIR /boost_1_84_0/ | ||
RUN ./bootstrap.sh --with-libraries=python --with-python=python3.7 &&\ | ||
./b2 install variant=release debug-symbols=off install --layout=system &&\ | ||
./bootstrap.sh --with-libraries=python --with-python=python3.8 &&\ | ||
./b2 install variant=release debug-symbols=off install --layout=system &&\ | ||
./bootstrap.sh --with-libraries=python --with-python=python3.9 &&\ | ||
./b2 install variant=release debug-symbols=off install --layout=system &&\ | ||
./bootstrap.sh --with-libraries=python --with-python=python3.10 &&\ | ||
./b2 install variant=release debug-symbols=off install --layout=system &&\ | ||
./bootstrap.sh --with-libraries=python --with-python=python3.11 &&\ | ||
./b2 install variant=release debug-symbols=off install --layout=system &&\ | ||
./bootstrap.sh --with-libraries=python --with-python=python3.12 &&\ | ||
./b2 install variant=release debug-symbols=off install --layout=system | ||
WORKDIR / | ||
RUN rm -rfv /boost_1_84_0 | ||
RUN curl -L https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.1.tar.gz | tar xz | ||
WORKDIR /cfitsio-4.3.1 | ||
RUN ./configure --prefix=/usr/local && make install | ||
WORKDIR / | ||
RUN rm -rfv /cfitsio-4.3.1 | ||
RUN curl -L https://github.com/icecube/photospline/archive/refs/tags/v2.2.1.tar.gz | tar xz | ||
RUN cmake -E env LDFLAGS="-lz" cmake -S photospline-2.2.1 -B photospline_build -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release &&\ | ||
make install -C photospline_build | ||
WORKDIR / | ||
RUN rm -rfv photospline-2.2.1 phosopline_build |
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
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