summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Mayer <entroP@gmail.com>2023-04-14 11:30:01 +0200
committerJustin Mayer <entroP@gmail.com>2023-04-14 11:30:01 +0200
commit42012ccf5b297b08ac7872ba320c2724f9f56ab7 (patch)
tree03d76e45ecd501642e28d0f8ca2954aee37e4370
parentc8795428d816ed9a7a4f8b285de62906bdf2cf91 (diff)
downloadfeedgenerator-42012ccf5b297b08ac7872ba320c2724f9f56ab7.tar.gz
Automate PyPI package publication via AutoPub
-rw-r--r--.github/workflows/main.yml31
-rw-r--r--pyproject.toml18
2 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 83b584e..6e548a2 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -27,3 +27,34 @@ jobs:
run: |
python -m pip install pytest pytest-cov
pytest
+
+ deploy:
+ name: Deploy
+ environment: Deployment
+ needs: test
+ runs-on: ubuntu-latest
+ if: github.ref=='refs/heads/main' && github.event_name!='pull_request'
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.9"
+
+ - name: Check release
+ id: check_release
+ run: |
+ python -m pip install poetry githubrelease httpx==0.18.2 autopub twine wheel
+ echo "release=$(autopub check)" >> $GITHUB_OUTPUT
+
+ - name: Publish
+ if: ${{ steps.check_release.outputs.release=='' }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ TWINE_USERNAME: "__token__"
+ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+ run: |
+ git remote set-url origin https://$GITHUB_TOKEN@github.com/${{ github.repository }}
+ autopub deploy
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..ff154bb
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,18 @@
+[tool.poetry]
+name = "feedgenerator"
+version = "2.0.0"
+description = "Standalone version of django.utils.feedgenerator"
+authors = ["Pelican Dev Team <authors@getpelican.com>"]
+readme = "README.rst"
+license = "BSD-3-Clause"
+keywords = ["feed", "atom", "rss"]
+
+[tool.autopub]
+project-name = "feedgenerator"
+git-username = "botpub"
+git-email = "52496925+botpub@users.noreply.github.com"
+version-strings = ["setup.py"]
+build-system = "setuptools"
+
+[build-system]
+requires = ["setuptools >= 40.6.0", "wheel"]