Merge pull request #132 from NHSDigital/develop #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: create-release | |
| on: | |
| push: | |
| branches: | |
| - release | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'NHSDigital/mesh-client' && github.actor != 'dependabot[bot]' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: clean | |
| run: | | |
| git clean -fdx | |
| find . -type f | xargs chmod g+w | |
| - name: setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: 'pyproject.toml' | |
| - name: setup poetry | |
| uses: abatilo/actions-poetry@3765cf608f2d4a72178a9fc5b918668e542b89b1 | |
| with: | |
| poetry-version: 2.1.3 | |
| - name: add poetry plugins | |
| run: | | |
| poetry self add "poetry-dynamic-versioning[plugin]" | |
| - name: dist | |
| run: | | |
| RELEASE_VERSION="$(poetry version patch | rev | cut -d' ' -f1 | rev)" | |
| echo "${RELEASE_VERSION}" | |
| echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV | |
| if [[ "${RELEASE_VERSION}" == "0.0.0" ]]; then | |
| echo "${RELEASE_VERSION} = 0.0.0" | |
| exit 1 | |
| fi | |
| git tag "${RELEASE_VERSION}" | |
| RELEASE_VERSION="${RELEASE_VERSION}" make dist | |
| - name: create release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| continue-on-error: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.RELEASE_VERSION }} | |
| release_name: ${{ env.RELEASE_VERSION }} | |
| - name: pypi publish | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_TOKEN }} | |