From 7095c1e43649b0e2a438521729846952975bf8b5 Mon Sep 17 00:00:00 2001 From: David Matsalla Date: Thu, 21 May 2026 19:47:53 -0700 Subject: [PATCH 1/2] Artifact updates --- .github/workflows/deploy-pypi.yml | 51 ++++++++++++++++++++++++----- .github/workflows/manual-deploy.yml | 9 ++--- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-pypi.yml b/.github/workflows/deploy-pypi.yml index 1fceb25a..388a80d4 100644 --- a/.github/workflows/deploy-pypi.yml +++ b/.github/workflows/deploy-pypi.yml @@ -8,6 +8,8 @@ on: jobs: deploy: runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} steps: - name: Checkout code uses: actions/checkout@v6 @@ -33,6 +35,10 @@ jobs: run: | cd rapidfireai/frontend node ./yarn/releases/yarn-4.9.1.cjs build + + - name: Get version from pyproject.toml + id: version + run: echo "version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")" >> $GITHUB_OUTPUT - name: Install Python dependencies run: | @@ -44,16 +50,43 @@ jobs: rm -rf dist/ *.egg-info/ .eggs/ python -m build - - name: Upload to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_SUPPORT_DEV }} - run: | - python -m twine upload dist/* + - name: Verify package metadata + run: twine check dist/* - name: Upload build artifacts uses: actions/upload-artifact@v7 with: - name: dist-files - path: dist/ - retention-days: 30 \ No newline at end of file + name: rapidfireai-${{ steps.version.outputs.version }}-wheel-${{ github.ref_name }} + path: dist/*.whl + retention-days: 90 + if-no-files-found: error + + publish-to-pypi: + name: Publish to PyPI + needs: [deploy] + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/rapidfireai + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download build artifacts + uses: actions/download-artifact@v8 + with: + name: rapidfireai-${{ needs.deploy.outputs.version }}-wheel-${{ github.ref_name }} + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + print-hash: true + + - name: Summary + run: | + echo "🎉 Successfully published version: ${{ needs.deploy.outputs.version }}" + echo "📦 Package available at: https://pypi.org/project/rapidfireai/" + echo "Access the package at https://pypi.org/project/rapidfireai/${{ needs.deploy.outputs.version }}/" \ No newline at end of file diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index 2b3f0e3e..6648728e 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -157,11 +157,12 @@ jobs: - name: Verify package metadata run: twine check dist/* - - name: Upload build artifacts + - name: Upload wheel artifact uses: actions/upload-artifact@v7 with: - name: python-package-distributions - path: dist/ + name: rapidfireai-${{ steps.determine_version.outputs.new_numeric_version }}-wheel-${{ github.ref_name }} + path: dist/*.whl + retention-days: 60 if-no-files-found: error publish-to-pypi: @@ -181,7 +182,7 @@ jobs: - name: Download build artifacts uses: actions/download-artifact@v8 with: - name: python-package-distributions + name: rapidfireai-${{ needs.version-and-build.outputs.new_numeric_version }}-wheel-${{ github.ref_name }} path: dist/ - name: Publish to PyPI From 50bf48c8e76480af3d24bc6c60dae0b39e2bd58f Mon Sep 17 00:00:00 2001 From: David Matsalla Date: Fri, 29 May 2026 14:13:25 -0700 Subject: [PATCH 2/2] Remove .whl upload --- .github/workflows/deploy-pypi.yml | 2 +- .github/workflows/manual-deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pypi.yml b/.github/workflows/deploy-pypi.yml index 388a80d4..1fa21aa9 100644 --- a/.github/workflows/deploy-pypi.yml +++ b/.github/workflows/deploy-pypi.yml @@ -57,7 +57,7 @@ jobs: uses: actions/upload-artifact@v7 with: name: rapidfireai-${{ steps.version.outputs.version }}-wheel-${{ github.ref_name }} - path: dist/*.whl + path: dist/* retention-days: 90 if-no-files-found: error diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index 6648728e..eb9f6540 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -161,7 +161,7 @@ jobs: uses: actions/upload-artifact@v7 with: name: rapidfireai-${{ steps.determine_version.outputs.new_numeric_version }}-wheel-${{ github.ref_name }} - path: dist/*.whl + path: dist/* retention-days: 60 if-no-files-found: error