Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/build_and_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
env:
MAIN_PYTHON_VERSION: "3.11"
POETRY_VERSION: "2.3.2"
PACKAGE_NAME: "VISOR"

# For Solutions private PyPI:
POETRY_HTTP_BASIC_SOLUTIONS_PRIVATE_PYPI_USERNAME: "PAT"
Expand Down Expand Up @@ -77,6 +78,10 @@ jobs:
(needs.update-changelog.result == 'success' || needs.update-changelog.result == 'skipped') &&
(github.event_name != 'schedule' || github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
permissions:
id-token: write # Required for PyPI trusted publisher authentication (OIDC)
attestations: write # Required by pypa/gh-action-pypi-publish (>=v1.11)
contents: write # Needed to download release artifacts
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -266,24 +271,24 @@ jobs:
path: dist/*.whl

- name: Release to Azure Solutions PyPI
if : (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
if: |
(github.event_name == 'schedule' && github.ref == 'refs/heads/main') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
uses: ansys-internal/solution-applications-actions/release-to-private-pypi@v18
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
twine-repository-url: https://pkgs.dev.azure.com/ansys-solutions/_packaging/ansys-solutions/pypi/upload/
twine-username: "TOKEN"
twine-password: ${{ secrets.SOLUTIONS_PRIVATE_PYPI_UPLOAD_TOKEN }}

- name: Release to Azure PyAnsys PyPI
if: |
(github.event_name == 'schedule' && github.ref == 'refs/heads/main') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
uses: ansys-internal/solution-applications-actions/release-to-private-pypi@v18
- name: "Upload artifacts to PyPI"
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
twine-repository-url: https://pkgs.dev.azure.com/pyansys/_packaging/ansys-solutions/pypi/upload/
twine-username: "TOKEN"
twine-password: ${{ secrets.SOLUTIONS_PRIVATE_PYPI_ADMIN_TOKEN }}
repository-url: "https://upload.pypi.org/legacy/"
print-hash: true
packages-dir: ${{ env.PACKAGE_NAME }}-artifacts
skip-existing: false

outputs:
package_version: ${{ steps.set_package_version.outputs.package_version }}
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/11.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Push releases to public PyPI
Loading