Files
Template-python/.github/workflows/main.yml

44 lines
1.0 KiB
YAML

name: CI/CD
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on:
push:
branches:
- main
tags:
- '*'
pull_request:
env:
# This is the default version of Python to use in most steps which aren't specific
DEFAULT_PYTHON_VERSION: "3.11"
jobs:
build_publish:
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
- name: Install tools
run: |
python -m pip install --upgrade pip
pip install twine wheel setuptools
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish
run: |
export TWINE_USERNAME=${{ secrets.TWINE_USERNAME }}
export TWINE_PASSWORD=${{ secrets.TWINE_PASSWORD }}
twine upload dist/*