Chore GH Actions workflows to use release event & asset uploads
#22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish RF-DETR Releases to PyPI | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main, develop] | |
| paths: | |
| - '.github/workflows/build-package.yml' | |
| - '.github/workflows/publish-release.yml' | |
| permissions: | |
| contents: write # Required for uploading assets to release | |
| jobs: | |
| build-pkg: | |
| uses: ./.github/workflows/build-package.yml | |
| publish-release: | |
| name: Publish Release Package | |
| needs: build-pkg | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: release | |
| url: https://pypi.org/project/rfdetr/ | |
| timeout-minutes: 10 | |
| permissions: | |
| id-token: write # Required for PyPI publishing | |
| steps: | |
| - name: 📥 Download distribution artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Display distribution files | |
| run: ls -lh dist/ | |
| - name: 📤 Upload assets to GitHub Release | |
| if: github.event_name == 'release' | |
| uses: AButler/[email protected] | |
| with: | |
| files: 'dist/*' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 🚀 Publish to PyPi | |
| if: github.event_name != 'pull_request' | |
| uses: pypa/[email protected] | |
| with: | |
| attestations: true |