From 20cd0e14744eee32f2b27267e883ff952ef0c90f Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 18 Jan 2021 11:19:12 +0100 Subject: [PATCH] run deploy step on forks if secrets are set --- .github/workflows/main.yml | 13 ++++++++----- requirements-dev.txt | 5 ++++- test/freeze-requirements.sh | 3 +-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be81050e..55544cbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/* diff --git a/requirements-dev.txt b/requirements-dev.txt index c71210ee..ce8b8c3b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 @@ -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 @@ -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 diff --git a/test/freeze-requirements.sh b/test/freeze-requirements.sh index 4bb95da8..4c4a76cb 100644 --- a/test/freeze-requirements.sh +++ b/test/freeze-requirements.sh @@ -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