diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 5841605..eb097d1 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -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: @@ -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: @@ -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 @@ -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