From ab3893202ae9cece4d2ff592956d17e27a17fe19 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Sat, 18 May 2024 10:25:47 +0200 Subject: [PATCH] PyPi release script --- .github/workflows/pypi-publish.yml | 18 ++++++++++++++++-- MANIFEST.in | 1 + README.md | 4 ++++ pyproject.toml | 13 +++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 MANIFEST.in create mode 100644 pyproject.toml diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index d62150b..a573609 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,5 +1,9 @@ name: Upload Package to PyPi +# the authorization is handled via trusted published, see https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/ on: + push: + branches: + - 'testpypi' workflow_run: workflows: [CI validation] branches: [master] @@ -8,15 +12,25 @@ on: permissions: contents: read - +# jobs: deploy: runs-on: ubuntu-latest + permissions: + id-token: write steps: - uses: actions/checkout@v4 + - name: Version bump + uses: monperrus/pyproject-bump-pypi@main + with: + file_to_bump: "./pyproject.toml" + bump_type: "minor" + - name: Set up Python uses: actions/setup-python@v3 with: python-version: '3.x' + - run: pip install build + - run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + uses: pypa/gh-action-pypi-publish@release/v1.8 diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..a45ca40 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include *.json diff --git a/README.md b/README.md index 49e7834..db421e1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ This repository contains a list of of HTTP user-agents used by robots, crawlers, and spiders as in single JSON file. +* NPM package: +* Go package: +* PyPi package: + ## Install ### Direct download diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d8b4dca --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,13 @@ +[project] +name = "crawler-user-agents" +version = "0.1" + +authors = [ + { name="Martin Monperrus", email="martin.monperrus@gnieh.org" }, +] + +readme = "README.md" + +[tool.setuptools.packages.find] +where = [ "." ] +