Skip to content

Commit

Permalink
Update deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jvsguerra committed Nov 4, 2024
1 parent 3ba70f1 commit 053f3d7
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 66 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build and deploy

on:
release:
types: [published]
workflow_dispatch:

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Build sdist
run: |
pipx run build --sdist
- name: Test sdist
run: |
pip install dist/*.tar.gz
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist/*.tar.gz

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: [macos-latest, macos-13, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.2

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v3
with:
name: artifacts
path: ./wheelhouse/*.whl

pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [build_sdist, build_wheels]
environment:
name: pypi
url: https://pypi.org/p/pyKVFinder
permissions:
id-token: write

steps:
- uses: actions/setup-python@v5
with:
python-version: 3.x

- uses: actions/download-artifact@v3
with:
name: artifacts
path: ./dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
66 changes: 0 additions & 66 deletions .github/workflows/publish-release.yml

This file was deleted.

0 comments on commit 053f3d7

Please sign in to comment.