Skip to content

Bump actions/upload-artifact from 3 to 4 #382

Bump actions/upload-artifact from 3 to 4

Bump actions/upload-artifact from 3 to 4 #382

Workflow file for this run

name: Wheels
on:
release:
types:
- published
- edited
pull_request:
branches:
- main
env:
CIBW_BUILD: "cp39-* cp310-* cp311-*"
CIBW_SKIP: "*-win32 *musllinux*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
jobs:
build_nix_wheels:
name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'docs only')
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
# Note: cibuildwheel builds for many Python versions beyond this one
python-version: "3.9"
# Mac:
- name: Setup Mac
if: runner.os == 'macOS'
run: |
brew install gsl
# Ubuntu:
- name: Setup Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install gsl-bin libgsl0-dev
- name: Build wheels
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.9"
- name: Build sdist
run: |
sudo apt-get update
sudo apt-get install gsl-bin libgsl0-dev
pip install build
python -m build -s .
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_nix_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: release
url: https://pypi.org/p/gala
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1