Skip to content

Commit

Permalink
change twine upload creds
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBok committed Mar 12, 2024
1 parent f615303 commit 39f3d36
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/utils/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def find_and_copy(from_folder: Path,
else:
pat = re.compile(pattern)

print(f"Copying files from {from_folder} to {to_folder}")

for file in Path(from_folder).rglob('*'):
if file.is_file():
if pat is None or pat.search(file.as_posix()):
Expand Down
42 changes: 26 additions & 16 deletions .github/workflows/test-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,35 +203,32 @@ jobs:
with:
python-version: '3.10'

- name: Retrieve packages
uses: actions/download-artifact@v4
with:
path: dist

- name: Install twine
run: pip install twine

- name: List repository
run: ls -al dist/*

- name: Checkout utilities
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/utils
sparse-checkout-cone-mode: false

- name: Retrieve packages
uses: actions/download-artifact@v4
with:
path: dist

- name: Find and copy packages to files/
run: |
mkdir files
ls -al .github/*
python .github/utils/find.py -from dist -pattern "(.tar.gz|.whl)$" -to files
ls -ltR
python .github/utils/find.py -from dist -to files -pattern "(.tar.gz|.whl)$"
- name: Upload packages to testpypi
env:
TWINE_USERNAME: ${{ secrets.PYPI_TEST_UID }}
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PWD }}
run: python -m twine upload --skip-existing --repository testpypi files/*
TWINE_USERNAME: ${{ secrets.PYPI_TEST_TOKEN_NAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
run: python -m twine upload --skip-existing --repository testpypi files/* --verbose

deploy:
name: Deploy packages to PyPI
Expand All @@ -245,16 +242,29 @@ jobs:
with:
python-version: '3.10'

- name: Install twine
run: pip install twine

- name: Checkout utilities
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/utils
sparse-checkout-cone-mode: false

- name: Retrieve packages
uses: actions/download-artifact@v4
with:
path: dist

- name: Install twine
run: pip install twine
- name: Find and copy packages to files/
run: |
mkdir files
ls -ltR
python .github/utils/find.py -from dist -to files -pattern "(.tar.gz|.whl)$"
- name: Upload packages to pypi
env:
TWINE_USERNAME: ${{ secrets.PYPI_UID }}
TWINE_PASSWORD: ${{ secrets.PYPI_PWD }}
run: python -m twine upload --skip-existing dist/*
run: python -m twine upload --skip-existing dist/* --verbose

0 comments on commit 39f3d36

Please sign in to comment.