Repository: zpieslak/mobilus-client (language: python)

Issue:
Add workflow that automates publishing to pypi
Add a pypi workflow that will react on tag create and publish the package on pypi.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..d1bd4ca
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,23 @@
+name: Publish
+
+on:
+  push:
+    tags:
+      - "v*"
+jobs:
+  publish:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      id-token: write
+    steps:
+      - uses: actions/checkout@v4
+      - uses: actions/setup-python@v5
+        with:
+          python-version: "3.12"
+      - name: Install dependencies
+        run: pip install build
+      - name: Build package
+        run: python -m build
+      - name: Publish package distributions to PyPI
+        uses: pypa/gh-action-pypi-publish@release/v1


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 5209048..362736d 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -7,28 +7,26 @@ on:
   pull_request:
     branches:
       - main
-
-permissions:
-  contents: read
-
 jobs:
   build:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     strategy:
       matrix:
         python-version: ["3.9", "3.10", "3.11", "3.12"]
     steps:
-    - uses: actions/checkout@v4
-    - uses: actions/setup-python@v5
-      with:
-        python-version: ${{ matrix.python-version }}
-    - name: Install dependencies
-      run: pip install -e .[test]
-    - name: Lint with flake8
-      run: flake8 . --count --statistics
-    - name: Lint with mypy
-      run: mypy .
-    - name: Test
-      run: coverage run -m unittest -v
-    - name: Verify coverage
-      run: coverage report --fail-under=95
+      - uses: actions/checkout@v4
+      - uses: actions/setup-python@v5
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Install dependencies
+        run: pip install -e ".[test]"
+      - name: Lint with flake8
+        run: flake8 . --count --statistics
+      - name: Lint with mypy
+        run: mypy .
+      - name: Test
+        run: coverage run -m unittest -v
+      - name: Verify coverage
+        run: coverage report --fail-under=95