fishyboteso/.github/workflows/python-publish.yml

47 lines
1.2 KiB
YAML
Raw Normal View History

2023-02-10 04:51:04 +00:00
name: Upload Python Package
on:
push:
2023-02-10 20:21:14 +00:00
branches:
- main
2023-02-10 04:51:04 +00:00
permissions:
contents: read
jobs:
2023-02-10 20:21:14 +00:00
check:
2023-02-10 04:51:04 +00:00
runs-on: ubuntu-latest
2023-02-10 20:21:14 +00:00
outputs:
changed: ${{ steps.changed-files-specific.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@v35
with:
files: fishy/version.txt # Alternatively using: `docs/**` or `docs`
2023-02-10 04:51:04 +00:00
2023-02-10 20:21:14 +00:00
deploy:
runs-on: ubuntu-latest
needs: check
if: ${{ needs.check.outputs.changed == 'true' }}
2023-02-10 04:51:04 +00:00
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}