Skip to content

Commit

Permalink
WIP 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Delgan committed Dec 5, 2024
1 parent 633016d commit 8fd8a03
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 39 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Packaging
on: [push, pull_request]

jobs:
packaging:
build:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-22.04
steps:
Expand All @@ -19,4 +19,46 @@ jobs:
python -m pip install tox
- name: Build package
run: |
tox -e packaging
tox -e build
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-test:
runs-on: ubuntu-22.04
if: github.event_name == 'push'
needs: build
environment:
name: testpypi
url: https://test.pypi.org/project/loguru/
permissions:
id-token: write
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
publish:
runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: build
environment:
name: pypi
url: https://pypi.org/project/loguru/
permissions:
id-token: write
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@release/v1
27 changes: 0 additions & 27 deletions .github/workflows/release.yml

This file was deleted.

11 changes: 1 addition & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ description = Build the HTML documentation.
commands =
sphinx-build -a -b html -W --keep-going docs/ docs/build

[testenv:packaging]
[testenv:build]
description = Build the Python package.
commands =
pyproject-build .
twine check --strict dist/*

[testenv:release]
description = Publish a new release on PyPI.
passenv =
TWINE_USERNAME
TWINE_PASSWORD
commands =
{[testenv:packaging]commands}
twine upload dist/* --disable-progress-bar --verbose

0 comments on commit 8fd8a03

Please sign in to comment.