From d6102b4da917e07b9fe1bd612b6bdf6d38aa0a0c Mon Sep 17 00:00:00 2001 From: Brenton Cleeland Date: Wed, 6 Dec 2023 07:31:14 +1100 Subject: [PATCH] feat: publish to pypi --- .github/workflows/publish.yml | 62 +++++++++++++++++++++++++++++++++++ setup.cfg | 3 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5afd07f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,62 @@ +name: Publish Package + +on: + release: + types: [created] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install tld beautifulsoup4 + + - name: Test with unittest + run: | + python -m unittest discover test + + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + needs: [test] + environment: + name: pypi + url: https://pypi.org/p/ready-check + permissions: + id-token: write + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install test dependencies + run: | + pip install -e '.' + + - name: Install publishing dependencies + run: | + pip install setuptools wheel twine build + + - name: Build python package + run: | + python -m build + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/setup.cfg b/setup.cfg index 2ca3f24..657c440 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = ready +name = ready-check version = 1.1.0 author = Brenton Cleeland author_email = brenton@brntn.me @@ -18,3 +18,4 @@ python_requires = >=3.9 install_requires = thttp tld + beautifulsoup4