Skip to content

Commit

Permalink
prepare for merge to main and deploy to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasibalic committed May 19, 2024
1 parent ab144db commit c161853
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Build wheels

on: [push]
name: Test, build, release

on:
pull_request:
branches:
- master
push:
branches:
- master
- 'releases/**'
release:
types: [created]

jobs:
format_test:
Expand Down Expand Up @@ -55,6 +64,7 @@ jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
needs: [function_test]
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -71,9 +81,6 @@ jobs:

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -102,9 +109,7 @@ jobs:
environment: deploy
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')
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Get artifacts
uses: actions/download-artifact@v4
Expand All @@ -115,6 +120,4 @@ jobs:
merge-multiple: true

- name: Upload
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit c161853

Please sign in to comment.