add version command #13
Workflow file for this run
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
on: | |
push: | |
tags: | |
- '*.*.*' | |
name: Publish shy-sh to PyPI | |
jobs: | |
build: | |
name: Release to PyPI | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.8.4 | |
- name: Install dependencies | |
run: poetry config pypi-token.pypi ${{ secrets.PYPY_API_TOKEN }} | |
- name: Update version | |
run: poetry version ${{ github.ref_name }} | |
- name: Commit version | |
run: | | |
git add pyproject.toml | |
git commit -m "Bump version to ${{ github.ref_name }}" | |
git push | |
- name: Publish package | |
run: poetry publish --build | |
- name: Zip dist | |
run: zip --junk-paths dist.zip dist/* | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist.zip | |
asset_name: shy-sh.zip | |
asset_content_type: application/zip |