Skip to content

Commit

Permalink
Add PyPI uploading to workflow (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfuxu authored Sep 4, 2023
1 parent 58be810 commit 2248ebd
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Build Wheels
on:
push:
branches: ["master"]
paths: ["dither_go/**", ".github/workflows/build_wheel.yml"]
paths: [".github/workflows/build_wheel.yml", "dither_go/**", "!dither_go/bindings/**"]
pull_request:
paths: ["dither_go/**", ".github/workflows/build_wheel.yml"]
paths: [".github/workflows/build_wheel.yml", "dither_go/**", "!dither_go/bindings/**"]
workflow_dispatch:
workflow_call:

Expand All @@ -19,8 +19,10 @@ jobs:
- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: source
path: dist/*.tar.gz

build_macos:
Expand Down Expand Up @@ -120,7 +122,7 @@ jobs:
env:
CIBW_BUILD: "cp3${{ matrix.python3_version }}*_aarch64"
CIBW_BUILD_FRONTEND: "build"
CIBW_SKIP: "cp36-* cp37-* *-musllinux_aarch64"
CIBW_SKIP: "cp36-* cp37-* *-musllinux_aarch64"
CIBW_ARCHS: "aarch64"
CIBW_ENVIRONMENT: >
PATH=$PATH:/usr/local/go/bin
Expand Down Expand Up @@ -233,6 +235,34 @@ jobs:
name: wheels
path: ./wheelhouse/*.whl

upload_to_pypi:
name: Upload to PyPI
needs:
- build_sdist
- build_macos
- build_linux_x86_64
- build_linux_arm64
#- build_linux_armv7l
#- build_windows
runs-on: ubuntu-latest
environment: pypi-upload
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Get source distribution
uses: actions/download-artifact@v3
with:
name: source
path: dist
- name: Get all built distributions
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

all_builds_passed:
needs:
- build_sdist
Expand Down

0 comments on commit 2248ebd

Please sign in to comment.