Merge pull request #41 from janelia-cellmap/radius-of-gyration #9
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: Publish and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Upgrade pip & install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install numpy Cython setuptools wheel build auditwheel | |
| - name: Build sdist & wheel | |
| run: python -m build | |
| - name: Repair Linux wheels for manylinux2014 | |
| run: | | |
| for whl in dist/*.whl; do | |
| auditwheel repair "$whl" \ | |
| --plat manylinux2014_x86_64 \ | |
| -w dist/ | |
| done | |
| - name: Remove original linux_x86_64 wheels | |
| run: rm -f dist/*linux_x86_64.whl | |
| - name: Upload Linux distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-dist | |
| path: dist/ | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Upgrade pip & install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install numpy Cython setuptools wheel build | |
| - name: Build macOS wheel | |
| run: python -m build --wheel --no-isolation | |
| - name: Upload macOS wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-wheel | |
| path: dist/*.whl | |
| publish-to-pypi: | |
| needs: | |
| - build-linux | |
| - build-macos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Linux distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: package-dist | |
| path: dist | |
| - name: Download macOS wheel | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-wheel | |
| path: dist | |
| - name: List distributions | |
| run: ls -l dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.5.1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| create-release: | |
| needs: publish-to-pypi | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref }} | |
| name: Release ${{ github.ref }} | |
| body: "Automatically created release from GitHub Actions" |