o sin e nanpa ilo #22
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: | |
- "*" | |
workflow_dispatch: | |
jobs: | |
release-pypi: | |
name: release-pypi | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: "3.11" # semi-arbitrary | |
- name: Check prerelease | |
id: check_version | |
run: | | |
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9.]+$ ]]; then | |
echo "PRERELEASE=false" >> $GITHUB_OUTPUT | |
else | |
echo "PRERELEASE=true" >> $GITHUB_OUTPUT | |
fi | |
# NOTE: pdm build does not require dependencies | |
- name: Build artifacts | |
run: pdm build | |
- name: Publish package distributions to PyPI | |
run: pdm publish --no-build | |
- name: Create release | |
uses: comnoco/[email protected] | |
# github's actions/create-release is archived | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: v${{ github.ref }} | |
draft: false | |
prerelease: ${{ steps.check_version.outputs.PRERELEASE }} |