From c10bd7ed0cf15de8b288c564a1373b2675e8ae0c Mon Sep 17 00:00:00 2001 From: uiolee <22849383+uiolee@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:02:52 +0800 Subject: [PATCH] ci: publish to TestPyPI --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++----- .github/workflows/publish.yml | 1 + pyproject.toml | 36 ++++++++++++++++++++++-------- 3 files changed, 64 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 170c18f..b6cd5a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,16 +4,22 @@ on: push: branches: ["main"] paths: + - "src/**" + - "test/**" - "**.py" - "**.gpx" - "**.sh" + - "pyproject.toml" - ".github/workflows/ci.yml" pull_request: branches: ["main"] paths: + - "src/**" + - "test/**" - "**.py" - "**.gpx" - "**.sh" + - "pyproject.toml" - ".github/workflows/ci.yml" permissions: @@ -38,11 +44,12 @@ jobs: --user - name: Build a binary wheel and a source tarball run: python3 -m build - # - name: Store the distribution packages - # uses: actions/upload-artifact@v3 - # with: - # name: python-package-distributions - # path: dist/ + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + retention-days: 1 test-cli: runs-on: ${{ matrix.os }} @@ -63,3 +70,27 @@ jobs: run: | chmod +x ./test/cli.test.sh ./test/cli.test.sh + + publish-to-testpypi: + name: Publish 🐍 TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: test.pypi.org + url: https://test.pypi.org/p/ezon-gpx + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b03a1fc..6a7124b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,6 +30,7 @@ jobs: with: name: python-package-distributions path: dist/ + retention-days: 1 publish-to-pypi: name: Publish to PyPI diff --git a/pyproject.toml b/pyproject.toml index c240982..34618c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,34 @@ -[build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - [project] name = "ezon-gpx" version = "1.0.0" -authors = [ - {name = "Uiolee"}, -] +authors = [{ name = "Uiolee" }] +maintainers = [{ name = "Uiolee" }] +description = "convert Ezon gpx files." +keywords = ["ezon", "gpx", "xml", "running_page"] readme = "README.md" -license = {text = "MPL-2.0"} +license = { file = "LICENSE" } + +classifiers = [ + "Development Status :: 4 - Beta", + + "Topic :: Text Processing :: Markup :: XML", + "Topic :: File Formats", + "Topic :: Utilities", + + "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", + + "Natural Language :: English", + + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS", + + "Programming Language :: Python :: 3.11", +] + +[project.urls] +Homepage = "https://github.com/uiolee/ezon-gpx" +Issues = "https://github.com/uiolee/ezon-gpx/issues" [project.scripts] ezon-gpx = "cli:cli" -