Merge pull request #81 from jcapriot/circle_fix #6
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: Release | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
# Don't upload this one to pypi, otherwise it will be preferred over every compiled one | |
# We can host it here on github though for those that need it (re: jupyter-light). | |
pure_python: | |
name: Create pure-python wheel | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Build pure python wheel and install | |
run: | | |
python -m pip install --user --upgrade build | |
python -m build | |
find ./dist/*.whl | xargs pip install | |
python -c "import geoana; geoana.show_config()" | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ./dist/geoana*.whl | |
distribute: | |
name: Distribute documentation | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
environment-file: .github/environment_ci.yml | |
activate-environment: geoana-test | |
python-version: "3.11" | |
- name: Install Our Package | |
run: | | |
pip install --no-build-isolation --editable . --config-settings=setup-args="-Dwith_extensions=true" | |
- name: Build documentation | |
run: | | |
cd docs | |
make html | |
cd .. | |
- name: GitHub Pages | |
uses: crazy-max/[email protected] | |
with: | |
build_dir: docs/_build/html | |
fqdn: geoana.simpeg.xyz | |
jekyll: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release: | |
name: Create Release | |
needs: [ | |
build_wheels, | |
build_sdist, | |
pure_python | |
] | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
# unpacks all CIBW artifacts into dist/ | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- name: Release to github | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
generate_release_notes: true | |
prerelease: false | |
- name: Remove anywheel before pypi upload | |
run: rm -f dist/geoana*none-any.whl | |
- name: Upload wheels to pypi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip-existing: true | |
packages-dir: ./dist/ |