mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-12-16 10:30:05 +01:00
50 lines
1.0 KiB
YAML
50 lines
1.0 KiB
YAML
---
|
|
|
|
name: Python package
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python for release
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.12
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r build-requirements.txt
|
|
|
|
- name: Build the package
|
|
run: |
|
|
python setup.py sdist bdist_wheel
|
|
|
|
- name: Upload package to PyPI
|
|
uses: pypa/gh-action-pypi-publish@v1
|
|
with:
|
|
user: ${{ secrets.PYPI_USERNAME }}
|
|
password: ${{ secrets.PYPI_PASSWORD }}
|
|
|
|
- name: Create GitHub release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
dist/*
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Clean up
|
|
run: |
|
|
rm -rf dist
|