Merge pull request #13 from YanhuiJessica/dependabot/pip/docs/eth-abi… #69
Workflow file for this run
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: | |
name: Build distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
publish-to-pypi: | |
name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/cheb3 | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
update-docs-requirements: | |
name: Update docs requirements | |
if: startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install pip-tools | |
run: python3 -m pip install pip-tools | |
- name: Update requirements.txt | |
run: cd docs/ && pip-compile requirements.in > requirements.txt | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Docs requirements automatic updates | |
file_pattern: '*.txt' | |
skip_dirty_check: false |