properly call version tag name in workflow #8
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: Upload release to PyPI | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
pypi-publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/pong-arcade/ | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install build | |
run: >- | |
pip install build | |
- name: Extract tag name | |
id: tag | |
run: echo "{TAG_NAME}={$(echo $GITHUB_REF | cut -d / -f 3)}" >> $GITHUB_OUTPUT | |
- name: Update version in pyproject.toml | |
run: >- | |
sed -i 's/{{VERSION_PLACEHOLDER}}/${{steps.tag.outputs.TAG_NAME }}/g' pyproject.toml | |
- name: Build a binary wheel | |
run: >- | |
python3 -m build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |