Doc-deploy-changelog action setup#

When a new tag is pushed, the doc-deploy-changelog action generates a new section of the CHANGELOG.md file if fragment files exist in their designated directory, for example doc/changelog.d. By default, the CHANGELOG.md file is updated in the release branch corresponding to the tag being pushed, such as release/0.1, and a pull request is created to merge the CHANGELOG update and deleted fragment files into main.

Use the following link to set up the ansys/actions/doc-changelog action before setting up the doc-deploy-changelog action: Doc-changelog action setup Once the doc-changelog action is done being set up, continue with the doc-deploy-changelog action setup:

  1. Add the doc-deploy-changelog as the first job of the ci_cd.yml file, and make the update-changelog job a requirement of the release job:

update-changelog:
  name: "Update CHANGELOG for new tag"
  if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
  runs-on: ubuntu-latest
  permissions:
    contents: write
    pull-requests: write
  steps:
    - uses: ansys/actions/doc-deploy-changelog@{{ version }}
      with:
        token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}

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

    - name: Release to GitHub
      uses: ansys/actions/release-github@{{ version }}
      with:
        library-name: ${{ env.PACKAGE_NAME }}

Warning

PyAnsys CI Bot needs to be an Admin of the repository to run the doc-deploy-changelog action.

  1. Optional - Add the package line to the tool.towncrier section of the pyproject.toml. This is the same as the name under tool.flit.module:

[tool.towncrier]
# Uses the version from the pyproject.toml instead of the tag being pushed
package = "ansys.<product>.<library>"