Skip to content
Merged
Show file tree
Hide file tree
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
51 changes: 42 additions & 9 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
name: rapidfireai-${{ steps.version.outputs.version }}-wheel-${{ github.ref_name }}
path: dist/*
retention-days: 90
Comment thread
david-rfai marked this conversation as resolved.
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 }}/"
9 changes: 5 additions & 4 deletions .github/workflows/manual-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
retention-days: 60
if-no-files-found: error

publish-to-pypi:
Expand All @@ -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
Expand Down
Loading