some guideline for mcmc-fitting #111
Workflow file for this run
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: Build and Upload Wheels | |
| on: | |
| push: | |
| tags: ['v*.*.*'] | |
| workflow_dispatch: | |
| jobs: | |
| build_wheels: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Build wheels | |
| run: | | |
| python -m pip install cibuildwheel | |
| python -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" | |
| CIBW_SKIP: "*-win32* *_i686* *musllinux*" | |
| CIBW_ARCHS_WINDOWS: "AMD64 ARM64" | |
| CIBW_ARCHS_MACOS: "x86_64 arm64" | |
| CIBW_BEFORE_BUILD: > | |
| python -m pip install wheel scikit-build-core>=0.4.3 pybind11>=2.6.0 numpy>=1.20 | |
| CIBW_TEST_COMMAND: python -c "from VegasAfterglow import ObsData, Setups, Fitter, ParamDef, Scale; print('OK')" | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: wheelhouse/ | |
| if-no-files-found: error | |
| publish: | |
| name: Publish to PyPI | |
| needs: build_wheels | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: wheelhouse/ | |
| - name: Build and publish | |
| run: | | |
| mkdir -p dist | |
| find wheelhouse -type f -name '*.whl' -exec mv '{}' dist/ \; | |
| - name: Build source distribution | |
| run: | | |
| python -m pip install --upgrade build scikit-build-core>=0.4.3 pybind11>=2.6.0 | |
| python -m build --sdist --outdir dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| package_dir: dist | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |