From f8194f7eb577a661cd2ba32c48c9cb041bd28806 Mon Sep 17 00:00:00 2001 From: Luis Real Date: Fri, 5 Jun 2026 12:16:53 -0600 Subject: [PATCH 1/6] Add PyPI publishing Add steps to publish job to publish distribution packages to Test PyPI and PyPI --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f10983..66f29cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -297,10 +297,12 @@ jobs: fi pytest -rsf -k "${known_failures}" test/ - # TODO: change this placeholder to the actual job publishing artifacts to PyPI publish: needs: [ compose, test-torchcodec ] + if: github.event_name == 'release' runs-on: ubuntu-24.04 + permissions: + id-token: write env: WHEELS: torchlib-all-wheels steps: @@ -311,4 +313,13 @@ jobs: path: _wheels - name: 'List wheels' run: | - ls _wheels + ls _wheels/* + - name: Publish package distributions to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + packages-dir: _wheels/* + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: _wheels/* From cc0f4bd7495777f4776f107369b7458474648481 Mon Sep 17 00:00:00 2001 From: Luis Real Date: Fri, 5 Jun 2026 12:40:49 -0600 Subject: [PATCH 2/6] Add missing trigger for CI workflow Add trigger for releases creation --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66f29cb..1025493 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,9 @@ on: branches: - main - 'release/**' + release: + types: + - published permissions: read-all @@ -314,11 +317,6 @@ jobs: - name: 'List wheels' run: | ls _wheels/* - - name: Publish package distributions to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - packages-dir: _wheels/* - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From fc3cae323734ac26c4b49186f44f7304b629275a Mon Sep 17 00:00:00 2001 From: Luis Real Date: Mon, 15 Jun 2026 12:30:08 -0600 Subject: [PATCH 3/6] Add simple wheels check before publishing --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1025493..2e81c83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -316,7 +316,15 @@ jobs: path: _wheels - name: 'List wheels' run: | - ls _wheels/* + tree _wheels/ + - name: 'Check wheels' + run: | + TORCHCODEC_WHEELS=`ls _wheels/*/torchcodec_xpu-*-manylinux_2_24_x86_64.whl | wc -l` + TORCHLIB_WHEELS=`ls _wheels/*/torchlib_xpu-*-py3-none-any.whl | wc -l` + ALL_FILES=`ls _wheels/*/* | wc -l` + if [[ $TORCHCODEC_WHEELS != 5 || $TORCHLIB_WHEELS != 1 || $ALL_FILES != 6 ]] ; then + exit 1; + fi - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From c53bd9d5387ffd1cf970d0f8db0eb5a332221b92 Mon Sep 17 00:00:00 2001 From: Luis Real Date: Mon, 15 Jun 2026 14:45:28 -0600 Subject: [PATCH 4/6] Update .github/workflows/ci.yml Co-authored-by: Dmitry Rogozhkin --- .github/workflows/ci.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e81c83..72560ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -317,14 +317,12 @@ jobs: - name: 'List wheels' run: | tree _wheels/ - - name: 'Check wheels' + - name: 'Prepare wheels' run: | - TORCHCODEC_WHEELS=`ls _wheels/*/torchcodec_xpu-*-manylinux_2_24_x86_64.whl | wc -l` - TORCHLIB_WHEELS=`ls _wheels/*/torchlib_xpu-*-py3-none-any.whl | wc -l` - ALL_FILES=`ls _wheels/*/* | wc -l` - if [[ $TORCHCODEC_WHEELS != 5 || $TORCHLIB_WHEELS != 1 || $ALL_FILES != 6 ]] ; then - exit 1; - fi + rm -rf _publish && mkdir _publish + cp "./_wheels/${{ env.WHEELS }}-${{ env.PR_OR_SHA }}-${{ env.UNIQUE_ID }}/torchcodec_xpu-*.whl" _publish/ + cp "./_wheels/${{ env.WHEELS }}-${{ env.PR_OR_SHA }}-${{ env.UNIQUE_ID }}/torchlib_xpu-*.whl" _publish/ + ls -al _publish/ - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From 82ad485770b54ec80ef7f79c3612179568290f2f Mon Sep 17 00:00:00 2001 From: Luis Real Date: Mon, 15 Jun 2026 14:52:54 -0600 Subject: [PATCH 5/6] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72560ad..94a6092 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -302,7 +302,6 @@ jobs: publish: needs: [ compose, test-torchcodec ] - if: github.event_name == 'release' runs-on: ubuntu-24.04 permissions: id-token: write @@ -324,6 +323,7 @@ jobs: cp "./_wheels/${{ env.WHEELS }}-${{ env.PR_OR_SHA }}-${{ env.UNIQUE_ID }}/torchlib_xpu-*.whl" _publish/ ls -al _publish/ - name: Publish package distributions to PyPI + if: github.event_name == 'release' uses: pypa/gh-action-pypi-publish@release/v1 with: - packages-dir: _wheels/* + packages-dir: _publish From 518c88d5ca9ccf31080b164925641b75bfa7e78b Mon Sep 17 00:00:00 2001 From: Luis Real Date: Mon, 15 Jun 2026 16:07:42 -0600 Subject: [PATCH 6/6] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94a6092..8068661 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -319,8 +319,8 @@ jobs: - name: 'Prepare wheels' run: | rm -rf _publish && mkdir _publish - cp "./_wheels/${{ env.WHEELS }}-${{ env.PR_OR_SHA }}-${{ env.UNIQUE_ID }}/torchcodec_xpu-*.whl" _publish/ - cp "./_wheels/${{ env.WHEELS }}-${{ env.PR_OR_SHA }}-${{ env.UNIQUE_ID }}/torchlib_xpu-*.whl" _publish/ + cp ./_wheels/${{ env.WHEELS }}-${{ env.PR_OR_SHA }}-${{ env.UNIQUE_ID }}/torchcodec_xpu-*.whl _publish/ + cp ./_wheels/${{ env.WHEELS }}-${{ env.PR_OR_SHA }}-${{ env.UNIQUE_ID }}/torchlib_xpu-*.whl _publish/ ls -al _publish/ - name: Publish package distributions to PyPI if: github.event_name == 'release'