|
1 | | -# This workflow will upload a Python Package to PyPI when a release is created |
2 | | -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries |
3 | | - |
4 | | -# This workflow uses actions that are not certified by GitHub. |
5 | | -# They are provided by a third-party and are governed by |
6 | | -# separate terms of service, privacy policy, and support |
7 | | -# documentation. |
8 | | - |
9 | | -name: Upload Python Package |
10 | | - |
11 | | -on: |
12 | | - release: |
13 | | - types: [published] |
14 | | - |
15 | | -permissions: |
16 | | - contents: read |
17 | | - |
18 | | -jobs: |
19 | | - release-build: |
20 | | - runs-on: ubuntu-latest |
21 | | - |
22 | | - steps: |
23 | | - - uses: actions/checkout@v4 |
24 | | - |
25 | | - - name: Checkout repository |
26 | | - uses: actions/checkout@v4 |
27 | | - with: |
28 | | - submodules: 'recursive' |
29 | | - token: ${{ secrets.PAT_TOKEN }} |
30 | | - |
31 | | - - uses: actions/setup-python@v5 |
32 | | - with: |
33 | | - python-version: "3.x" |
34 | | - |
35 | | - - name: Install Build |
36 | | - run: | |
37 | | - # NOTE: put your own distribution build steps here. |
38 | | - python -m pip install build |
39 | | - |
40 | | - - name: Build wheels |
41 | | - uses: pypa/cibuildwheel@v3.0.1 |
42 | | - # env: |
43 | | - with: |
44 | | - package-dir: . |
45 | | - output-dir: wheelhouse |
46 | | - config-file: "{package}/pyproject.toml" |
47 | | - |
48 | | - - name: Upload distributions |
49 | | - uses: actions/upload-artifact@v4 |
50 | | - with: |
51 | | - name: release-dists |
52 | | - path: wheelhouse/ |
53 | | - |
54 | | - pypi-publish: |
55 | | - runs-on: ubuntu-latest |
56 | | - needs: |
57 | | - - release-build |
58 | | - permissions: |
59 | | - # IMPORTANT: this permission is mandatory for trusted publishing |
60 | | - id-token: write |
61 | | - |
62 | | - # Dedicated environments with protections for publishing are strongly recommended. |
63 | | - # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules |
64 | | - environment: |
65 | | - name: pypi |
66 | | - url: https://pypi.org/p/TensorArray/${{ github.event.release.name }} |
67 | | - # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: |
68 | | - # url: https://pypi.org/p/YOURPROJECT |
69 | | - # |
70 | | - # ALTERNATIVE: if your GitHub Release name is the PyPI project version string |
71 | | - # ALTERNATIVE: exactly, uncomment the following line instead: |
72 | | - # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} |
73 | | - |
74 | | - steps: |
75 | | - - name: Retrieve release distributions |
76 | | - uses: actions/download-artifact@v4 |
77 | | - with: |
78 | | - name: release-dists |
79 | | - path: wheelhouse/ |
80 | | - |
81 | | - - name: Publish release distributions to PyPI |
82 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
83 | | - with: |
84 | | - packages-dir: wheelhouse/ |
85 | | - |
86 | | - testpypi-publish: |
87 | | - runs-on: ubuntu-latest |
88 | | - needs: |
89 | | - - release-build |
90 | | - permissions: |
91 | | - # IMPORTANT: this permission is mandatory for trusted publishing |
92 | | - id-token: write |
93 | | - |
94 | | - # Dedicated environments with protections for publishing are strongly recommended. |
95 | | - # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules |
96 | | - environment: |
97 | | - name: testpypi |
98 | | - url: https://test.pypi.org/p/TensorArray/${{ github.event.release.name }} |
99 | | - # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: |
100 | | - # url: https://pypi.org/p/YOURPROJECT |
101 | | - # |
102 | | - # ALTERNATIVE: if your GitHub Release name is the PyPI project version string |
103 | | - # ALTERNATIVE: exactly, uncomment the following line instead: |
104 | | - # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} |
105 | | - |
106 | | - steps: |
107 | | - - name: Retrieve release distributions |
108 | | - uses: actions/download-artifact@v4 |
109 | | - with: |
110 | | - name: release-dists |
111 | | - path: wheelhouse/ |
112 | | - |
113 | | - - name: Publish release distributions to TestPyPI |
114 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
115 | | - with: |
116 | | - repository-url: https://test.pypi.org/legacy/ |
117 | | - packages-dir: wheelhouse/ |
118 | | - |
| 1 | +# This workflow will upload a Python Package to PyPI when a release is created |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries |
| 3 | + |
| 4 | +# This workflow uses actions that are not certified by GitHub. |
| 5 | +# They are provided by a third-party and are governed by |
| 6 | +# separate terms of service, privacy policy, and support |
| 7 | +# documentation. |
| 8 | + |
| 9 | +name: Upload Python Package |
| 10 | + |
| 11 | +on: |
| 12 | + release: |
| 13 | + types: [published] |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + |
| 18 | +jobs: |
| 19 | + release-build: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + submodules: 'recursive' |
| 29 | + token: ${{ secrets.PAT_TOKEN }} |
| 30 | + |
| 31 | + - uses: actions/setup-python@v5 |
| 32 | + with: |
| 33 | + python-version: "3.x" |
| 34 | + |
| 35 | + - name: Install Build |
| 36 | + run: | |
| 37 | + # NOTE: put your own distribution build steps here. |
| 38 | + python -m pip install build |
| 39 | + |
| 40 | + - name: Build wheels |
| 41 | + uses: pypa/cibuildwheel@v3.0.1 |
| 42 | + # env: |
| 43 | + with: |
| 44 | + package-dir: . |
| 45 | + output-dir: wheelhouse |
| 46 | + config-file: "{package}/pyproject.toml" |
| 47 | + |
| 48 | + - name: Upload distributions |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: release-dists |
| 52 | + path: wheelhouse/ |
| 53 | + |
| 54 | + pypi-publish: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + needs: |
| 57 | + - release-build |
| 58 | + permissions: |
| 59 | + # IMPORTANT: this permission is mandatory for trusted publishing |
| 60 | + id-token: write |
| 61 | + |
| 62 | + # Dedicated environments with protections for publishing are strongly recommended. |
| 63 | + # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules |
| 64 | + environment: |
| 65 | + name: pypi |
| 66 | + url: https://pypi.org/p/TensorArray/${{ github.event.release.name }} |
| 67 | + # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: |
| 68 | + # url: https://pypi.org/p/YOURPROJECT |
| 69 | + # |
| 70 | + # ALTERNATIVE: if your GitHub Release name is the PyPI project version string |
| 71 | + # ALTERNATIVE: exactly, uncomment the following line instead: |
| 72 | + # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} |
| 73 | + |
| 74 | + steps: |
| 75 | + - name: Retrieve release distributions |
| 76 | + uses: actions/download-artifact@v4 |
| 77 | + with: |
| 78 | + name: release-dists |
| 79 | + path: wheelhouse/ |
| 80 | + |
| 81 | + - name: Publish release distributions to PyPI |
| 82 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 83 | + with: |
| 84 | + packages-dir: wheelhouse/ |
| 85 | + |
| 86 | + testpypi-publish: |
| 87 | + runs-on: ubuntu-latest |
| 88 | + needs: |
| 89 | + - release-build |
| 90 | + permissions: |
| 91 | + # IMPORTANT: this permission is mandatory for trusted publishing |
| 92 | + id-token: write |
| 93 | + |
| 94 | + # Dedicated environments with protections for publishing are strongly recommended. |
| 95 | + # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules |
| 96 | + environment: |
| 97 | + name: testpypi |
| 98 | + url: https://test.pypi.org/p/TensorArray/${{ github.event.release.name }} |
| 99 | + # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: |
| 100 | + # url: https://pypi.org/p/YOURPROJECT |
| 101 | + # |
| 102 | + # ALTERNATIVE: if your GitHub Release name is the PyPI project version string |
| 103 | + # ALTERNATIVE: exactly, uncomment the following line instead: |
| 104 | + # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} |
| 105 | + |
| 106 | + steps: |
| 107 | + - name: Retrieve release distributions |
| 108 | + uses: actions/download-artifact@v4 |
| 109 | + with: |
| 110 | + name: release-dists |
| 111 | + path: wheelhouse/ |
| 112 | + |
| 113 | + - name: Publish release distributions to TestPyPI |
| 114 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 115 | + with: |
| 116 | + repository-url: https://test.pypi.org/legacy/ |
| 117 | + packages-dir: wheelhouse/ |
| 118 | + |
0 commit comments