Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PyPI uploading to workflow #6

Merged
merged 7 commits into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading