Skip to content

Install poetry then cache #5

Install poetry then cache

Install poetry then cache #5

Workflow file for this run

name: Build and Publish
on:
push:
branches:
- release
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Upgrade pip
run: |
pip install pip
pip --version
- name: Install Poetry
run: |
pip install poetry
poetry --version
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'poetry'
- 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 "release_tag=$(git rev-parse HEAD | head -c 8)" >> $GITHUB_OUTPUT
- 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
- name: Remove other releases
uses: sgpublic/delete-release-action@v1.1
with:
release-drop: true
release-keep-count: 2
release-drop-tag: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}