46 lines
No EOL
1.1 KiB
YAML
46 lines
No EOL
1.1 KiB
YAML
name: ytld-sub PyPI
|
|
on:
|
|
push:
|
|
# Publish `master` as Docker `latest` image.
|
|
branches:
|
|
- master
|
|
|
|
# Publish `v1.2.3` tags as releases.
|
|
tags:
|
|
- v*
|
|
|
|
# Run tests for any PRs.
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
name: build-and-publish
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
matrix:
|
|
python-version: [ "3.10" ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Build Wheel
|
|
run: |
|
|
make wheel
|
|
|
|
- name: Publish distribution 📦 to Test PyPI
|
|
if: ${{ github.ref != 'refs/heads/master' }}
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
|
|
repository_url: https://test.pypi.org/legacy/
|
|
|
|
- name: Publish distribution 📦 to PyPI
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
password: ${{ secrets.PYPI_API_TOKEN }} |