Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Delgan committed Dec 4, 2024
1 parent 633016d commit 8bec872
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Packaging
name: Build

on: [push, pull_request]

Expand All @@ -19,4 +19,9 @@ jobs:
python -m pip install tox
- name: Build package
run: |
tox -e packaging
tox -e build
- name: Test upload dist
uses: actions/upload-artifact@v4
with:
name: test-dists
path: dist/
16 changes: 10 additions & 6 deletions .github/workflows/release.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Publish

on:
push:
Expand All @@ -8,6 +8,11 @@ on:
jobs:
release:
runs-on: ubuntu-22.04
environment:
name: pypi
url: https://pypi.org/project/loguru/
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -19,9 +24,8 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Publish release
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
- name: Build package
run: |
tox -e release
tox -e build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
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 8bec872

Please sign in to comment.