Skip to content

Commit

Permalink
Update the publish.yml workflow for UV (#143)
Browse files Browse the repository at this point in the history
* Update the publish.yml workflow for UV

Signed-off-by: Fabrice Normandin <[email protected]>

* Remove hard-coded version in __version__.py

Signed-off-by: Fabrice Normandin <[email protected]>

---------

Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice authored Jan 31, 2025
1 parent e7c0df2 commit 92f16e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,17 @@ jobs:
environment: release
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
enable-cache: true
# https://github.com/astral-sh/setup-uv?tab=readme-ov-file#github-authentication-token
github-token: ${{ secrets.GITHUB_TOKEN }}
cache-suffix: ${{ matrix.python-version }}
- name: Install dependencies
run: |
poetry install
poetry self add "poetry-dynamic-versioning[plugin]"
poetry dynamic-versioning enable
run: uv sync
- name: Building the package
run: uv build
- name: Publish package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
run: uv publish --trusted-publishing always
4 changes: 3 additions & 1 deletion milatools/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "0.1.3"
import importlib.metadata

__version__ = importlib.metadata.version("milatools")
3 changes: 1 addition & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 92f16e9

Please sign in to comment.