Publish package to TestPyPI #193
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish package to TestPyPI | |
# on: | |
# push: | |
# branches: | |
# - 'main' | |
# paths: | |
# - 'gptcache/**' | |
# - '!**.md' | |
# - '.github/workflows/publish_dev_package.yaml' | |
# pull_request: | |
# branches: | |
# - main | |
# paths: | |
# - '.github/workflows/publish_dev_package.yaml' | |
on: | |
workflow_dispatch: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
- cron: '30 9 * * 1,4' | |
jobs: | |
build-and-publish-dev: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
# - name: Get history and tags for SCM versioning | |
# run: | | |
# git fetch --prune --unshallow | |
# git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Install pypi/build | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
- name: Publish distribution 📦 to Test PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_TEST_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ |