|
14 | 14 | env: |
15 | 15 | MAIN_PYTHON_VERSION: "3.11" |
16 | 16 | POETRY_VERSION: "2.3.2" |
| 17 | + PACKAGE_NAME: "VISOR" |
17 | 18 |
|
18 | 19 | # For Solutions private PyPI: |
19 | 20 | POETRY_HTTP_BASIC_SOLUTIONS_PRIVATE_PYPI_USERNAME: "PAT" |
|
77 | 78 | (needs.update-changelog.result == 'success' || needs.update-changelog.result == 'skipped') && |
78 | 79 | (github.event_name != 'schedule' || github.ref == 'refs/heads/main') |
79 | 80 | runs-on: ubuntu-latest |
| 81 | + permissions: |
| 82 | + id-token: write # Required for PyPI trusted publisher authentication (OIDC) |
| 83 | + attestations: write # Required by pypa/gh-action-pypi-publish (>=v1.11) |
| 84 | + contents: write # Needed to download release artifacts |
80 | 85 | steps: |
81 | 86 | - name: Checkout repository |
82 | 87 | uses: actions/checkout@v4 |
@@ -266,24 +271,24 @@ jobs: |
266 | 271 | path: dist/*.whl |
267 | 272 |
|
268 | 273 | - name: Release to Azure Solutions PyPI |
269 | | - if : (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) |
| 274 | + if: | |
| 275 | + (github.event_name == 'schedule' && github.ref == 'refs/heads/main') || |
| 276 | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) |
270 | 277 | uses: ansys-internal/solution-applications-actions/release-to-private-pypi@v18 |
271 | 278 | with: |
272 | 279 | python-version: ${{ env.MAIN_PYTHON_VERSION }} |
273 | 280 | twine-repository-url: https://pkgs.dev.azure.com/ansys-solutions/_packaging/ansys-solutions/pypi/upload/ |
274 | 281 | twine-username: "TOKEN" |
275 | 282 | twine-password: ${{ secrets.SOLUTIONS_PRIVATE_PYPI_UPLOAD_TOKEN }} |
276 | 283 |
|
277 | | - - name: Release to Azure PyAnsys PyPI |
278 | | - if: | |
279 | | - (github.event_name == 'schedule' && github.ref == 'refs/heads/main') || |
280 | | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) |
281 | | - uses: ansys-internal/solution-applications-actions/release-to-private-pypi@v18 |
| 284 | + - name: "Upload artifacts to PyPI" |
| 285 | + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) |
| 286 | + uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1 |
282 | 287 | with: |
283 | | - python-version: ${{ env.MAIN_PYTHON_VERSION }} |
284 | | - twine-repository-url: https://pkgs.dev.azure.com/pyansys/_packaging/ansys-solutions/pypi/upload/ |
285 | | - twine-username: "TOKEN" |
286 | | - twine-password: ${{ secrets.SOLUTIONS_PRIVATE_PYPI_ADMIN_TOKEN }} |
| 288 | + repository-url: "https://upload.pypi.org/legacy/" |
| 289 | + print-hash: true |
| 290 | + packages-dir: ${{ env.PACKAGE_NAME }}-artifacts |
| 291 | + skip-existing: false |
287 | 292 |
|
288 | 293 | outputs: |
289 | 294 | package_version: ${{ steps.set_package_version.outputs.package_version }} |
|
0 commit comments