upgrade setup-python #2
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: Create Release | |
on: | |
push: | |
tags: | |
- v*.*.* # Triggers the workflow on version tags like v1.0.0 | |
permissions: read-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.10 | |
- name: Install Poetry | |
run: curl -sSL https://install.python-poetry.org | python3 - | |
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-ansi | |
- name: Build the package | |
run: poetry build | |
- name: Extract version | |
id: get_version | |
run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.ref }} # Use the tag that triggered the workflow | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Wheel Asset | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/say_hello-${{ env.VERSION }}-py3-none-any.whl | |
asset_name: say_hello-${{ env.VERSION }}-py3-none-any.whl | |
asset_content_type: application/zip | |
- name: Upload Source Distribution Asset | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/say_hello-${{ env.VERSION }}.tar.gz | |
asset_name: say_hello-${{ env.VERSION }}.tar.gz | |
asset_content_type: application/gzip |