Set a tag name #2
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: Build and Publish | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Upgrade pip | |
run: | | |
pip install pip | |
pip --version | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
poetry --version | |
- name: Install dependencies | |
run: poetry install --no-interaction | |
- name: Build wheel | |
run: poetry build | |
- name: Run Tests | |
run: poetry run pytest | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "::set-output name=release_tag::$(git rev-parse HEAD)" | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: dist/*.whl | |
draft: false | |
prerelease: false | |