header auto replace #33
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 distributions to PyPI | |
on: push | |
jobs: | |
build-n-publish: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install build | |
run: python3 -m pip install -U build | |
- name: Replace Raw | |
run: python3 -c "lines = open('README.rst', 'r').readlines(); header = open('PYPIHEADER.rst', 'r').readlines(); open('README.rst', 'w').writelines(header + ['\n'] + lines[14:])" | |
- name: Build | |
run: python3 -m build --outdir dist/ | |
- name: Publish | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |