Skip to content

Release

Release #3

Workflow file for this run

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