8000 collapse horrendous process of writing action · bcmyguest1/server-client-python@e08c8a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit e08c8a2

Browse files
committed
collapse horrendous process of writing action
pro tip: the answer to "how do I use an environment secret" is "don't do that, just use a repo secret"
1 parent 9796eec commit e08c8a2

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ on:
1515
tags: release
1616
branches: jac/pypi
1717

18-
buildwheels:
18+
jobs:
19+
build-n-publish:
1920
name: Build dist files for PyPi
20-
needs: createrelease
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@master
@@ -28,22 +28,16 @@ on:
2828
- name: Build dist files
2929
run: |
3030
python -m pip install --upgrade pip
31-
pip install -e
31+
pip install -e .[test]
3232
python setup.py sdist --formats=gztar,zip
33-
34-
# This action assumes files exist in /dist unless told otherwise
35-
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
36-
publish:
37-
- name: Publish distribution 📦 to Test PyPI
38-
if: startsWith(environment, 'test')
39-
needs: buildwheels
40-
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
41-
with:
42-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
43-
repository_url: https://test.pypi.org/legacy/
44-
- name: Publish distribution 📦 to PyPI
45-
if: startsWith(github.ref, 'refs/tags')
46-
needs: buildwheels
47-
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
48-
with:
49-
password: ${{ secrets.PYPI_API_TOKEN }}
33+
- name: Publish distribution 📦 to Test PyPI
34+
env:
35+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
36+
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
37+
with:
38+
password: $TEST_PYPI_API_TOKEN
39+
repository_url: https://test.pypi.org/legacy/
40+
- name: Publish distribution 📦 to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
42+
with:
43+
password: ${{ secrets.PYPI_API_TOKEN_WRONG }}

0 commit comments

Comments
 (0)
0