Release actions#

Release actions provide for releasing the various artifacts of a Python library.

These actions assume that you have used the Documentation actions and the Build actions. The reason is that the artifacts generated during these actions are the ones to be released.

Release PyPI private action#

Release library artifacts to the PyAnsys private index. Use the PYANSYS_PRIVATE_PYPI_TOKEN as the token. Artifacts get downloaded from the CI/CD pipeline and are assumed to be named <library-name>-artifacts. This file is expected to contain a wheel and a source distribution file for the desired library.

Source code for this action

Input

Description

Required

Type

Default

library-name

Name of the Python library to be published.

True

string

twine-username

User name used when uploading to the PyAnsys private index.

True

string

twine-token

Password used when uploading to the PyAnsys private index.

True

string

dry-run

Whether to run or not this action in testing mode. Testing mode executes all the action steps except the releasing artifacts one. This allows developers to verify the health of the action once integrated in their CI/CD pipelines without actually publishing artifacts. Default value is false.

False

boolean

0

skip-existing

Continue uploading files if one already exists. Only valid when uploading to PyPI. Other implementations may not support this.

False

boolean

1

python-version

Python version for installing and using twine.

False

string

3.1

Examples#

Release to private PyPI
release-pypi-private:
  name: "Release to private PyPI"
  runs-on: ubuntu-latest
  needs: [build-library]
  if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
  steps:
    - name: "Release to the private PyPI repository"
      uses: ansys/actions/release-pypi-private@v6.0
      with:
        library-name: "ansys-<product>-<library>"
        twine-username: "__token__"
        twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}

Release PyPI test action#

Release library artifacts to the Test PyPI public index. Use the PYANSYS_PYPI_TEST_PAT as the token. Artifacts get downloaded from the CI/CD pipeline and are assumed to be named <library-name>-artifacts. This file is expected to contain a wheel file and a source distribution file for the desired library.

Source code for this action

Input

Description

Required

Type

Default

library-name

Name of the Python library to be published.

True

string

twine-username

User name used when uploading to the public Test PyPI index.

True

string

twine-token

Password used when uploading to the public Test PyPI index.

True

string

dry-run

Whether to run or not this action in testing mode. Testing mode executes all the action steps except the releasing artifacts one. This allows developers to verify the health of the action once integrated in their CI/CD pipelines without actually publishing artifacts. Default value is false.

False

boolean

0

python-version

Python version for installing and using twine.

False

string

3.1

skip-existing

Continue uploading files if one already exists. Only valid when uploading to PyPI. Other implementations may not support this.

False

boolean

1

Examples#

Release to test PyPI
release-pypi-test:
  name: "Release to test PyPI"
  runs-on: ubuntu-latest
  needs: [build-library]
  if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
  steps:
    - name: "Release to the test PyPI repository"
      uses: ansys/actions/release-pypi-test@v6.0
      with:
        library-name: "ansys-<product>-<library>"
        twine-username: "__token__"
        twine-token: ${{ secrets.PYANSYS_PYPI_TEST_PAT }}

Release PyPI public action#

Release library artifacts to the PyPI public index. Use the PYPI_TOKEN as the token. Artifacts get downloaded from the CI/CD pipeline and are assumed to be named <library-name>-artifacts. This file is expected to contain a wheel file and a source distribution file for the desired library.

Source code for this action

Input

Description

Required

Type

Default

library-name

Name of the Python library to be published.

True

string

twine-username

User name used when uploading to the public PyPI index.

True

string

twine-token

Password used when uploading to the public PyPI index.

True

string

dry-run

Whether to run or not this action in testing mode. Testing mode executes all the action steps except the releasing artifacts one. This allows developers to verify the health of the action once integrated in their CI/CD pipelines without actually publishing artifacts. Default value is false.

False

boolean

0

skip-existing

Continue uploading files if one already exists. Only valid when uploading to PyPI. Other implementations may not support this.

False

boolean

1

python-version

Python version for installing and using twine.

False

string

3.1

Examples#

Release to public PyPI
release-pypi-public:
  name: "Release to public PyPI"
  runs-on: ubuntu-latest
  needs: [build-library]
  if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
  steps:
    - name: "Release to the public PyPI repository"
      uses: ansys/actions/release-pypi-public@v6.0
      with:
        library-name: "ansys-<product>-<library>"
        twine-username: "__token__"
        twine-token: ${{ secrets.PYPI_TOKEN }}

Release GitHub action#

Release library artifacts to the GitHub release section. Some minimum artifacts are required before running this action. These artifacts include documentation-html, documentation-pdf, and <library-name>-artifacts files. This last file must contain the wheels and source distribution files of the library.

Source code for this action

Input

Description

Required

Type

Default

library-name

Name of the Python library to be published.

True

string

additional-artifacts

String containing a list of additional artifacts to be included in the GitHub release.

False

string

dry-run

Whether to run or not this action in testing mode. Testing mode executes all the action steps except the releasing artifacts one. This allows developers to verify the health of the action once integrated in their CI/CD pipelines without actually publishing artifacts. Default value is false.

False

boolean

False

Examples#

Release to GitHub
release-gitub:
  name: "Release to GitHub"
  runs-on: ubuntu-latest
  needs: [build-library]
  if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
  steps:
    - name: "Release to GitHub"
      uses: ansys/actions/release-github@v6.0
      with:
        library-name: "ansys-<product>-<library>"