Package and Documentation Release #13
Workflow file for this run
This file contains 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: Release the Next Version of the Package and Documentation | |
on: | |
release: | |
types: [published] | |
jobs: | |
release-version: | |
runs-on: ubuntu-latest | |
steps: | |
- id: parse-version | |
name: Parse release version | |
run: | | |
echo "version=${RELEASE_VERSION/v/}" >> "$GITHUB_OUTPUT" | |
env: | |
RELEASE_VERSION: ${{ github.event.release.tag_name }} | |
outputs: | |
version: ${{ steps.parse-version.outputs.version }} | |
publish-test-pypi: | |
needs: release-version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install build | |
python3 -m pip install twine | |
- name: Build package | |
run: | | |
echo "Building package of version ${RELEASE_VERSION}" | |
python3 -m build | |
- name: Check package build | |
run: python3 -m twine check dist/* | |
- name: Publish package to Test-PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
env: | |
RELEASE_VERSION: ${{ needs.release-version.outputs.version }} | |
test-test-pypi: | |
needs: [release-version, publish-test-pypi] | |
uses: ./.github/workflows/tests.yml | |
with: | |
install_command: "python3 -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple gpu-tracker==${{ needs.release-version.outputs.version }}" | |
# - name: Publish package to PyPi | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# password: ${{ secrets.PYPI_API_TOKEN }} |