Release #3
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: Release | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
environment: pypi-publish | |
env: | |
VIRTUAL_ENV: .venv | |
permissions: | |
# for creating github release | |
contents: write | |
# for trusted publishing | |
id-token: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Set up PDM | |
uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: '3.11' | |
cache: true | |
- name: Install dependencies | |
run: | | |
python -m venv ${{ env.VIRTUAL_ENV }} | |
pdm sync --verbose --dev | |
- name: Run tests | |
run: | | |
source ${{ env.VIRTUAL_ENV }}/bin/activate | |
python -m pytest | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ github.ref }} | |
tag_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Build and publish to PyPI | |
run: | | |
source ${{ env.VIRTUAL_ENV }}/bin/activate | |
pdm publish |