Bump version: 0.1.4 → 0.2.0 #37
Workflow file for this run
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
name: main | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build-linux: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 14400 | |
strategy: | |
max-parallel: 3 | |
matrix: | |
PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup conda environment | |
run: | | |
curl -L https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh --output /tmp/conda.sh --silent \ | |
&& bash /tmp/conda.sh -b -p /opt/conda \ | |
&& rm -rf /tmp/conda.sh \ | |
&& source /opt/conda/etc/profile.d/conda.sh \ | |
&& mamba install -y python=${{ matrix.PYTHON_VERSION }} numpy scipy suitesparse pybind11 build wheel \ | |
&& python -m pip install jax jaxlib | |
- name: build library | |
run: | | |
source /opt/conda/etc/profile.d/conda.sh \ | |
&& conda activate base \ | |
&& git clone --depth 1 --branch stable https://github.com/DrTimothyAldenDavis/SuiteSparse suitesparse | |
&& python setup.py build sdist bdist_wheel \ | |
&& ls dist | |
- name: Expose wheel as artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: dist-linux | |
path: dist | |
build-windows: | |
runs-on: windows-2019 | |
timeout-minutes: 14400 | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup conda environment | |
run: | | |
Invoke-WebRequest -Uri "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe" -OutFile "conda.exe" | |
Start-Process "conda.exe" -Wait -ArgumentList @('/S', '/InstallationType=JustMe', '/RegisterPython=1', '/AddToPath=1', "/D=$CondaRoot") | |
$Env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User") | |
conda init powershell | |
$Env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User") | |
mamba install -y python=${{ matrix.PYTHON_VERSION }} numpy scipy suitesparse pybind11 build wheel | |
conda activate base | |
python -m pip install jax jaxlib | |
- name: build library | |
run: | | |
conda init powershell | |
conda activate base | |
git clone --depth 1 --branch stable https://github.com/DrTimothyAldenDavis/SuiteSparse suitesparse | |
python setup.py build sdist bdist_wheel | |
ls dist | |
- name: Expose wheel as artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: dist-windows | |
path: dist | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- build-linux | |
- build-windows | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
PYTHON_VERSION: ["38", "39", "310", "311"] | |
steps: | |
- name: Download linux build artifact | |
uses: actions/download-artifact@master | |
with: | |
name: dist-linux | |
path: dist | |
- name: Download windows build artifact | |
uses: actions/download-artifact@master | |
with: | |
name: dist-windows | |
path: dist | |
- name: Rename Linux wheels | |
run: | | |
cp dist/klujax-0.2.0-cp${{ matrix.PYTHON_VERSION }}-cp${{ matrix.PYTHON_VERSION }}-linux_x86_64.whl \ | |
dist/klujax-0.2.0-cp${{ matrix.PYTHON_VERSION }}-cp${{ matrix.PYTHON_VERSION }}-manylinux2014_x86_64.whl | |
rm dist/*-linux_x86_64.whl | |
- name: Show dist contents | |
run: ls dist | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/klujax-0.2.0-cp${{ matrix.PYTHON_VERSION }}-cp${{ matrix.PYTHON_VERSION }}-manylinux2014_x86_64.whl | |
dist/klujax-0.2.0-cp${{ matrix.PYTHON_VERSION }}-cp${{ matrix.PYTHON_VERSION }}-win_amd64.whl | |
- name: Publish to PyPI | |
run: | | |
pip install --user twine \ | |
&& twine upload \ | |
dist/klujax-0.2.0-cp${{ matrix.PYTHON_VERSION }}-cp${{ matrix.PYTHON_VERSION }}-manylinux2014_x86_64.whl \ | |
dist/klujax-0.2.0-cp${{ matrix.PYTHON_VERSION }}-cp${{ matrix.PYTHON_VERSION }}-win_amd64.whl \ | |
--username __token__ \ | |
--password ${{ secrets.PYPI_TOKEN }} | |
release-tarball: | |
runs-on: ubuntu-latest | |
needs: | |
- release | |
steps: | |
- name: Download linux build artifact | |
uses: actions/download-artifact@master | |
with: | |
name: dist-linux | |
path: dist | |
- name: Show dist contents | |
run: ls dist | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/klujax-0.2.0.tar.gz | |
- name: Publish to PyPI | |
run: | | |
pip install --user twine \ | |
&& twine upload \ | |
dist/klujax-0.2.0.tar.gz \ | |
--username __token__ \ | |
--password ${{ secrets.PYPI_TOKEN }} |