Repository: Teemu/pytest-sugar (language: python)

Issue:
Missing git tags for new releases
It would be nice to keep PyPI releases and git tags in sync :)


Discussion / hints:
https://github.com/Frozenball/pytest-sugar/releases
@Natim The releases page only includes releases up to 0.3.3, but the current version is 0.9.2 on PyPI.
Any update?
I think that's the way the project is released that makes it so. @Teemu would you consider using `zest.releaser` for your upcoming releases? It guess it would fix the issue at hand. If you want to I can take some time to backfill all the existing tags.
Hey @Natim! 👋 In a separate message to @Teemu, I recently made a similar proposal to use [AutoPub](http://justinmayer.com/projects/autopub/) to automate the release process and had intended to submit a PR to configure this project appropriately. That said, it doesn't matter to me which tool is used — streamlining the release process is the important part. 💫 

Either way, back-filling the existing tags seems like a great idea to me. 👍 
AutoPub would definitly work too, I don't know what is the current playbook for `pytest-sugar` releases :pray: 


I didn't know about `zest.releaser`, that def looks handy. I have done all my changelog & versioning manually so far. 😅

I think AutoPub could be worth trying and would actually empower others. As far as the git tagging goes, I haven't had the need for it personally. Of course, if we switch to some proper deployment flow, we get that for free so that's nice.
It is mainly useful for dependabot or renovabot to display a changelog during dependencies upgrade. It also allow to go directly at the right source code place when we find a bug and want to read the code.
I agree that keeping PyPI release versions and Git tags in sync is a useful thing to have. 👍 

In my personal experience, I've found AutoPub to indeed be just that: a tool that empowers others. I'll submit a PR as soon as I can to show how it could work for `pytest-sugar`.
Any progress about add missing git tags? (or at east last one) 😋 
As a precursor to submitting a PR to automate `pytest-sugar` releases via [AutoPub](http://justinmayer.com/projects/autopub/), I would like to rename the primary branch from `master` to `main`. Any objections?
If by Monday 3 April there are no objections to renaming the primary branch, I will proceed and rename it to `main`. ✨ 
main is ok
It's ok. 👍

Fix patch:
diff --git a/.gitignore b/.gitignore
index 8d33849..835cfc0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
 dist/
 build
 .coverage
+poetry.lock
diff --git a/CHANGES.rst b/CHANGES.rst
index 09f856e..79f7b75 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,8 +1,6 @@
 Changelog
 ---------
 
-A list of changes between each release.
-
 0.9.6 (2022-11-5)
 ^^^^^^^^^^^^^^^^^^^
 
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..3ff1114
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,50 @@
+[tool.poetry]
+name = "pytest-sugar"
+version = "0.9.6"
+description = "Pytest plugin that adds a progress bar and other visual enhancements"
+authors = ["Teemu <orkkiolento@gmail.com>", "Janne Vanhala <janne.vanhala@gmail.com>"]
+license = "BSD"
+readme = "README.md"
+keywords = ["testing", "pytest", "plugin"]
+
+repository = "https://github.com/Teemu/pytest-sugar"
+
+classifiers = [
+    "Development Status :: 4 - Beta",
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: BSD License",
+    "Operating System :: POSIX",
+    "Operating System :: Microsoft :: Windows",
+    "Operating System :: MacOS :: MacOS X",
+    "Topic :: Software Development :: Testing",
+    "Topic :: Software Development :: Libraries",
+    "Topic :: Utilities",
+]
+
+[tool.poetry.urls]
+"Tracker" = "https://github.com/Teemu/pytest-sugar/issues"
+
+[tool.poetry.dependencies]
+python = ">=3.8.1,<4.0"
+pytest = ">=6.2.0"
+termcolor = ">=2.1.0"
+packaging = ">=21.3"
+
+[tool.poetry.dev-dependencies]
+black = "^23.0"
+flake8 = "^3.9"
+isort = "^5.12"
+
+[tool.autopub]
+project-name = "pytest-sugar"
+git-username = "botpub"
+git-email = "52496925+botpub@users.noreply.github.com"
+append-github-contributor = true
+changelog-file = "CHANGES.rst"
+changelog-header = "---------"
+version-header = "^"
+version-strings = ["pytest_sugar.py"]
+build-system = "setuptools"
+
+[build-system]
+requires = ["setuptools >= 40.6.0", "wheel"]


Test patch:
diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml
index ee5b25f..c9a7fbb 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -39,3 +39,34 @@ jobs:
         env:
           TOXENV: ${{ matrix.toxenv }}
         run: tox
+
+  deploy:
+    name: Deploy
+    environment: Deployment
+    needs: test
+    runs-on: ubuntu-22.04
+    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