Cut new version #12
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: Cut new version | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| cut-new-version: | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
| with: | |
| python-version: '3.11' | |
| - run: pip install --upgrade pip | |
| - run: pip install bumpver | |
| - run: pip install git+https://github.com/morganstanley/releaseherald.git | |
| - name: git setup | |
| run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - run: bumpver update | |
| - run: bumpver show --env > new-version.txt | |
| - run: releaseherald generate --latest --no-update -t news.rst | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: new-version | |
| path: | | |
| new-version.txt | |
| news.rst | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: cut-new-version | |
| steps: | |
| - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
| - run: git pull origin | |
| - uses: ./.github/actions/build-package | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: package | |
| path: dist/ | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| needs: [cut-new-version, build] | |
| steps: | |
| - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
| with: | |
| sparse-checkout: | | |
| .github | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: new-version | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| path: dist/ | |
| - name: Get Version | |
| id: get_version | |
| run: | | |
| eval $(cat new-version.txt) | |
| echo "new_version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT | |
| - uses: ./.github/actions/create-release | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.new_version }} | |
| package: dist/testplan-${{ steps.get_version.outputs.new_version }}-py3-none-any.whl | |
| news: news.rst | |
| - name: Publish to Test PyPI | |
| if: ${{github.ref_name == 'test_pypi'}} | |
| uses: pypa/[email protected] | |
| with: | |
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| repository-url: https://test.pypi.org/legacy/ | |
| - name: Publish to PyPI | |
| if: ${{github.ref_name != 'test_pypi'}} | |
| uses: pypa/[email protected] | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} |