|
1 | 1 | name: CD | Publish Python 🐍 distributions 📦 to PyPI |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
6 | | - |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
7 | 7 | workflow_dispatch: |
8 | 8 |
|
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + pull-requests: write |
| 12 | + actions: write |
| 13 | + |
9 | 14 | jobs: |
| 15 | + release-please: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + outputs: |
| 18 | + release_created: ${{ steps.release.outputs.release_created }} |
| 19 | + tag_name: ${{ steps.release.outputs.tag_name }} |
| 20 | + steps: |
| 21 | + - uses: google-github-actions/release-please-action@v3 |
| 22 | + id: release |
| 23 | + with: |
| 24 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + release-type: python |
| 26 | + package-name: runpod |
| 27 | + |
10 | 28 | build-n-publish: |
11 | 29 | name: Build and publish Python 🐍 distributions 📦 to PyPI |
| 30 | + needs: release-please |
| 31 | + if: ${{ needs.release-please.outputs.release_created }} |
12 | 32 | runs-on: ubuntu-latest |
| 33 | + environment: release |
| 34 | + permissions: |
| 35 | + contents: read |
| 36 | + id-token: write # Required for OIDC |
13 | 37 |
|
14 | 38 | steps: |
15 | 39 | - uses: actions/checkout@v4 |
16 | | - - name: Set up Python 3.11.10 |
17 | | - uses: actions/setup-python@v5 |
| 40 | + - name: Install uv |
| 41 | + uses: astral-sh/setup-uv@v6 |
18 | 42 | with: |
19 | | - python-version: 3.11.10 |
| 43 | + enable-cache: true |
20 | 44 |
|
21 | | - - name: Install pypa/build |
22 | | - run: >- |
23 | | - python -m |
24 | | - pip install |
25 | | - build |
26 | | - --user |
| 45 | + - name: Set up Python 3.11.10 |
| 46 | + run: uv python install 3.11.10 |
27 | 47 |
|
28 | | - - name: Build a binary wheel and a source tarball |
29 | | - run: >- |
30 | | - python -m |
31 | | - build |
32 | | - --sdist |
33 | | - --wheel |
34 | | - --outdir dist/ |
35 | | - . |
| 48 | + - name: Build package |
| 49 | + run: uv build |
36 | 50 |
|
37 | 51 | - name: Publish distribution 📦 to Test PyPI |
38 | 52 | uses: pypa/gh-action-pypi-publish@release/v1 |
39 | 53 | with: |
40 | | - password: ${{ secrets.TEST_PYPI_API_TOKEN }} |
41 | | - repository_url: https://test.pypi.org/legacy/ |
| 54 | + repository-url: https://test.pypi.org/legacy/ |
42 | 55 |
|
43 | 56 | - name: Publish distribution 📦 to PyPI |
44 | | - # if: startsWith(github.ref, 'refs/tags') |
45 | 57 | uses: pypa/gh-action-pypi-publish@release/v1 |
46 | | - with: |
47 | | - password: ${{ secrets.PYPI_API_TOKEN }} |
48 | 58 |
|
49 | 59 | notify-runpod-workers: |
50 | 60 | name: Notify workers |
51 | | - needs: build-n-publish |
| 61 | + needs: [release-please, build-n-publish] |
| 62 | + if: ${{ needs.release-please.outputs.release_created }} |
52 | 63 | strategy: |
53 | 64 | matrix: |
54 | 65 | repo: |
|
75 | 86 | runs-on: ubuntu-latest |
76 | 87 |
|
77 | 88 | steps: |
78 | | - - name: Wait for propegation |
| 89 | + - name: Wait for propagation |
79 | 90 | run: sleep 300s |
80 | 91 | shell: bash |
81 | 92 |
|
|
0 commit comments