|
1 | 1 | name: CD |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - tags: |
6 | | - - '*' |
| 4 | + release: |
| 5 | + types: [published] |
7 | 6 |
|
8 | 7 | jobs: |
9 | | - build: |
10 | | - name: Build distribution |
| 8 | + release-build: |
11 | 9 | runs-on: ubuntu-latest |
12 | 10 |
|
13 | 11 | steps: |
14 | | - - uses: actions/checkout@v4 |
15 | | - - name: Set up Python |
16 | | - uses: actions/setup-python@v4 |
17 | | - with: |
18 | | - python-version: "3.10" |
19 | | - - name: Install pypa/build |
20 | | - run: >- |
21 | | - python3 -m |
22 | | - pip install |
23 | | - build |
24 | | - --user |
25 | | - - name: Build a binary wheel and a source tarball |
26 | | - run: python3 -m build |
27 | | - - name: Store the distribution packages |
28 | | - uses: actions/upload-artifact@v3 |
29 | | - with: |
30 | | - name: python-package-distributions |
31 | | - path: dist/ |
32 | | - |
33 | | - publish-to-pypi: |
34 | | - name: >- |
35 | | - Publish Python distribution 📦 to PyPI |
36 | | - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes |
37 | | - needs: |
38 | | - - build |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: "3.x" |
| 17 | + |
| 18 | + - name: Build release distributions |
| 19 | + run: | |
| 20 | + # NOTE: put your own distribution build steps here. |
| 21 | + python -m pip install build |
| 22 | + python -m build |
| 23 | +
|
| 24 | + - name: Upload distributions |
| 25 | + uses: actions/upload-artifact@v4 |
| 26 | + with: |
| 27 | + name: release-dists |
| 28 | + path: dist/ |
| 29 | + |
| 30 | + pypi-publish: |
39 | 31 | runs-on: ubuntu-latest |
| 32 | + |
| 33 | + needs: |
| 34 | + - release-build |
| 35 | + |
| 36 | + permissions: |
| 37 | + # IMPORTANT: this permission is mandatory for trusted publishing |
| 38 | + id-token: write |
| 39 | + |
| 40 | + # Dedicated environments with protections for publishing are strongly recommended. |
40 | 41 | environment: |
41 | 42 | name: pypi |
42 | 43 | url: https://pypi.org/p/wpodnet-pytorch |
43 | | - permissions: |
44 | | - id-token: write # IMPORTANT: mandatory for trusted publishing |
45 | 44 |
|
46 | 45 | steps: |
47 | | - - name: Download all the dists |
48 | | - uses: actions/download-artifact@v3 |
49 | | - with: |
50 | | - name: python-package-distributions |
51 | | - path: dist/ |
52 | | - - name: Publish distribution to PyPI |
53 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
| 46 | + - name: Retrieve release distributions |
| 47 | + uses: actions/download-artifact@v4 |
| 48 | + with: |
| 49 | + name: release-dists |
| 50 | + path: dist/ |
| 51 | + |
| 52 | + - name: Publish release distributions to PyPI |
| 53 | + uses: pypa/gh-action-pypi-publish@6f7e8d9c0b1a2c3d4e5f6a7b8c9d0e1f2a3b4c5d |
0 commit comments