diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6a56db81..b23011a9 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -12,43 +12,30 @@ on: release: types: [published] -env: - UV_CACHE_DIR: /tmp/.uv-cache - jobs: - deploy: + release: + name: Releasing to PyPi runs-on: ubuntu-latest - environment: release + environment: + name: release + url: https://pypi.org/manage/project/deebot-client/ permissions: + contents: write id-token: write steps: - - name: โคต๏ธ Checkout repository - uses: actions/checkout@v4 - - - name: ๐Ÿ— Install uv + - name: โคต๏ธ Check out code from GitHub + uses: actions/checkout@v4.2.2 + - name: ๐Ÿ— Set up uv uses: astral-sh/setup-uv@v3 with: enable-cache: true - cache-dependency-glob: "uv.lock" - cache-local-path: ${{ env.UV_CACHE_DIR }} - - - name: ๐Ÿ— Set up Python - uses: actions/setup-python@v5 - with: - python-version-file: ".python-version" - - - name: ๐Ÿ— Install the project - run: uv sync --dev --locked - + - name: ๐Ÿ— Set package version + run: | + sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml - name: ๐Ÿ“ฆ Build package run: uv build - - - name: ๐Ÿš€ Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - verbose: true - print-hash: true - + - name: ๐Ÿš€ Publish to PyPi + run: uv publish - name: โœ๏ธ Sign published artifacts uses: sigstore/gh-action-sigstore-python@v3.0.0 with: diff --git a/pyproject.toml b/pyproject.toml index 18ba51e5..037142c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling", "hatch-vcs"] +requires = ["hatchling"] build-backend = "hatchling.build" [project] @@ -29,7 +29,7 @@ dependencies = [ "pillow>=10.0.1,<11.0", "svg-py>=1.4.2", ] -dynamic = ["version"] +version = "0.0.0" [project.urls] "Homepage" = "https://deebot.readthedocs.io/" @@ -59,10 +59,6 @@ include = [ "/deebot_client", ] - -[tool.hatch.version] -source = "vcs" - [tool.ruff.lint] select = [ "ALL", diff --git a/uv.lock b/uv.lock index 108a666c..fea9798a 100644 --- a/uv.lock +++ b/uv.lock @@ -198,7 +198,7 @@ wheels = [ [[package]] name = "deebot-client" -version = "8.4.1.dev11+g2b37b96.d20241030" +version = "0.0.0" source = { editable = "." } dependencies = [ { name = "aiohttp" },