Skip to content

Bump mamba-org/setup-micromamba from 1 to 2 #124

Bump mamba-org/setup-micromamba from 1 to 2

Bump mamba-org/setup-micromamba from 1 to 2 #124

Workflow file for this run

name: build
# Build on every branch push, tag push, and pull request change:
#on: [push] #, pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'
release:
types:
- published
jobs:
build_wheels:
name: Build wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build wheels
run: |
git pull --tags origin main &&
python -m pip install --upgrade pip &&
python -m pip install build &&
python -m build --wheel
- name: Install from wheels and import
run: |
python -m pip install dist/*.whl &&
python -c "import lpath; print(lpath.__version__)" &&
python -c "import lpath.discretize" &&
python -c "import lpath.extract" &&
python -c "import lpath.match" &&
python -c "import lpath.lpath" &&
echo "All done with import tests!"
- uses: actions/upload-artifact@v4
with:
name: artifact-wheels
path: dist/*.whl
overwrite: true
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build sdist
run: |
git pull --tags origin main &&
python -m pip install --upgrade pip &&
python -m pip install build &&
python -m build --sdist
- name: Install from sdist and import
run: |
python -m pip install dist/*.tar.gz &&
python -c "import lpath; print(lpath.__version__)" &&
python -c "import lpath.discretize" &&
python -c "import lpath.extract" &&
python -c "import lpath.match" &&
python -c "import lpath.lpath" &&
echo "All done with import tests!"
- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*.tar.gz
overwrite: true
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
pattern: artifact-*
path: dist
merge-multiple: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1