Deploy Release #6
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: Deploy Release | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| tag-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Extract version from pyproject.toml | |
| id: get_version | |
| run: | | |
| VERSION=$(python -c " | |
| try: | |
| import tomllib | |
| with open('pyproject.toml', 'rb') as f: | |
| data = tomllib.load(f) | |
| print(data['project']['version']) | |
| except Exception as e: | |
| print(f'Error reading version: {e}', file=sys.stderr) | |
| exit(1) | |
| ") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Tag the release | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git tag v${{ steps.get_version.outputs.version }} | |
| git push origin v${{ steps.get_version.outputs.version }} | |
| deploy-pypi: | |
| needs: tag-release | |
| uses: ./.github/workflows/deploy-pypi.yml | |
| deploy-dockerhub: | |
| needs: deploy-pypi | |
| uses: ./.github/workflows/deploy-dockerhub.yml | |
| deploy-pyinstaller: | |
| needs: deploy-dockerhub | |
| uses: ./.github/workflows/deploy-pyinstaller.yml | |
| upload-release: | |
| needs: [deploy-pypi, deploy-dockerhub, deploy-pyinstaller] | |
| uses: ./.github/workflows/upload-artifacts.yml |