Skip to content

Commit

Permalink
run deploy step on forks if secrets are set
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Jan 18, 2021
1 parent c7afd73 commit 20cd0e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,21 @@ jobs:
name: ${{ matrix.os }}

deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment: deploy
if: github.repository == 'mitmproxy/pdoc' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [mypy, test]
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_REPOSITORY: ${{ secrets.TWINE_REPOSITORY }}
runs-on: ubuntu-latest
needs: [mypy, test]
steps:
- run: printenv
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: 3.9.1
- run: pip install -r requirements-dev.txt
- run: python setup.py bdist_wheel
- run: twine check
- run: twine upload
- run: twine check dist/*
- run: twine upload dist/*
5 changes: 4 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mccabe==0.6.1
mypy==0.790
mypy-extensions==0.4.3
packaging==20.8
pip==20.3.3
pkginfo==1.7.0
pluggy==0.13.1
py==1.10.0
Expand All @@ -31,13 +32,14 @@ pyflakes==2.2.0
Pygments==2.7.4
pyparsing==2.4.7
pytest==6.2.1
pytest-cov==2.10.1
pytest-cov==2.11.0
pytest-timeout==1.4.2
readme-renderer==28.0
requests==2.25.1
requests-toolbelt==0.9.1
rfc3986==1.4.0
SecretStorage==3.3.0
setuptools==49.2.1
six==1.15.0
toml==0.10.2
tox==3.21.1
Expand All @@ -48,3 +50,4 @@ typing-extensions==3.7.4.3
urllib3==1.26.2
virtualenv==20.3.1
webencodings==0.5.1
wheel==0.36.2
3 changes: 1 addition & 2 deletions test/freeze-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ rm -rf freeze-venv
python3.9 -m venv freeze-venv
freeze-venv/bin/python -m pip install -U pip
freeze-venv/bin/pip install -e ..[dev]
freeze-venv/bin/pip uninstall -y pdoc
freeze-venv/bin/pip freeze > ../requirements-dev.txt
freeze-venv/bin/pip freeze --all --exclude-editable > ../requirements-dev.txt
rm -rf freeze-venv

0 comments on commit 20cd0e1

Please sign in to comment.