Skip to content

Commit

Permalink
Update GitHub Actions workflows for building and deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Aug 6, 2024
1 parent 04b0b2c commit b26707c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 74 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/build.yml

This file was deleted.

71 changes: 21 additions & 50 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,31 @@
name: Build and upload to PyPI

on:
workflow_dispatch:
release:
types:
- published
types: [published]

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]

steps:
- uses: actions/checkout@v4
permissions:
contents: read

- name: Build wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
jobs:
deploy:

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

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'
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit b26707c

Please sign in to comment.