From ca8eff5679474b37d9d9e445932d0286a276ca1d Mon Sep 17 00:00:00 2001 From: ijl Date: Sat, 2 Nov 2024 00:41:45 +0000 Subject: [PATCH] Fix dist publish --- .github/workflows/artifact.yaml | 53 +++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/.github/workflows/artifact.yaml b/.github/workflows/artifact.yaml index 1faf5216..f5fd7daf 100644 --- a/.github/workflows/artifact.yaml +++ b/.github/workflows/artifact.yaml @@ -51,7 +51,7 @@ jobs: - run: ./integration/run typestubs - name: Store sdist - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: orjson_sdist @@ -144,7 +144,7 @@ jobs: cp ${CARGO_TARGET_DIR}/wheels/orjson*.whl dist - name: Store wheels - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: orjson_manylinux_2_17_amd64_${{ matrix.python.interpreter }} @@ -230,7 +230,7 @@ jobs: cp ${CARGO_TARGET_DIR}/wheels/orjson*.whl dist - name: Store wheels - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: orjson_manylinux_aarch64_${{ matrix.python.interpreter }} @@ -306,7 +306,7 @@ jobs: venv/bin/python -m pytest -v test - name: Store wheels - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: orjson_musllinux_${{ matrix.platform.arch }}_${{ matrix.python.version }} @@ -379,7 +379,7 @@ jobs: args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }} - name: Store wheels - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: orjson_manylinux_2_17_${{ matrix.target.arch }}_${{ matrix.python.version }} @@ -452,7 +452,7 @@ jobs: - run: source .venv/bin/activate && ./integration/run init - name: Store wheels - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: orjson_universal2_aarch64_${{ matrix.python.version }} @@ -522,7 +522,7 @@ jobs: - run: source .venv/bin/activate && ./integration/run init - name: Store wheels - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" uses: actions/upload-artifact@v4 with: name: orjson_universal2_amd64_${{ matrix.python.version }} @@ -533,11 +533,10 @@ jobs: pypi: name: PyPI runs-on: ubuntu-24.04 - if: "startsWith(github.ref, 'refs/tags/')" + # if: "startsWith(github.ref, 'refs/tags/')" needs: [ macos_aarch64, macos_amd64, - manylinux_aarch64, manylinux_amd64, manylinux_non_amd64, musllinux, @@ -552,7 +551,6 @@ jobs: - uses: actions/download-artifact@v4 with: merge-multiple: true - name: python-package-distributions path: dist/ pattern: orjson_* @@ -567,7 +565,38 @@ jobs: with: attestations: true packages-dir: dist - repository-url: https://github.com/ijl/orjson skip-existing: true - user: ijl + verbose: true + + pypi_slow: + name: PyPI + runs-on: ubuntu-24.04 + # if: "startsWith(github.ref, 'refs/tags/')" + needs: [ + manylinux_aarch64, + ] + environment: + name: pypi + url: https://pypi.org/p/orjson + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: dist/ + pattern: orjson_* + + - run: ls -1 dist/ + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + attestations: true + packages-dir: dist + skip-existing: true verbose: true