Add verion tag and Publish to PyPI #18
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: Add verion tag and Publish to PyPI | |
on: | |
workflow_dispatch: | |
jobs: | |
tag: | |
runs-on: ubuntu-latest | |
steps: | |
# set version | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: VERSION # only check out this file | |
sparse-checkout-cone-mode: false | |
- name: Get version | |
id: version | |
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT | |
# tag | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ steps.version.outputs.version }} | |
build-and-publish: | |
needs: tag | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
# build | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Python Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# build | |
- name: Execute publishing | |
run: make build | |
# publish | |
- uses: pypa/gh-action-pypi-publish@release/v1 |