Skip to content

fix auto release meta data (#12) #14

fix auto release meta data (#12)

fix auto release meta data (#12) #14

name: Publish release
on:
push:
branches: [ "main" ]
jobs:
pypi-publish:
runs-on: ubuntu-latest
environment: pypi-release
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v3
- name: Setup
run: |
python3 -m pip install pdm-bump
pdm sync --dev
- name: Build
run: pdm build
- name: Update git release tag
id: tagger
run: |
git config --global user.name 'Auto'
git config --global user.email '[email protected]'
pdm bump tag && git push --tags
tag=$( pdm show --version )
tag_is_full_release=$( test "${tag}" "=~" "^v[0-9]+.[0-9]+.[0-9]+\$" && TRUE || FALSE )
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "full-release=${tag_is_full_release}"
- name: Test and get reports
run: pdm reports
- uses: "marvinpinto/action-automatic-releases@latest"
id: gh-release
with:
prerelease: ${{ ! steps.tagger.full-release }}
automatic_release_tag: ${{ steps.tagger.tag }}
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: |
dist/*
badges/*.svg
- name: Publish package distributions to PyPI
run: pdm publish --no-build