From 49f9ea9dd79232dc41a4d7879409e95856a381e0 Mon Sep 17 00:00:00 2001
From: Simonas <20096648+simjak@users.noreply.github.com>
Date: Thu, 9 Nov 2023 15:26:49 +0200
Subject: [PATCH] updated release action

---
 .github/workflows/release.yml | 33 ++++++++++++++++++++++++---------
 setup.py                      |  7 +++++++
 2 files changed, 31 insertions(+), 9 deletions(-)
 create mode 100644 setup.py

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 66c806ef..1ef437a8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -14,20 +14,35 @@ jobs:
       uses: actions/setup-python@v2
       with:
         python-version: '3.x'
+    - name: Install Poetry
+      run: |
+        curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
     - name: Install dependencies
+      run: poetry install
+    - name: Build
+      run: poetry build
+
+  publish:
+    needs: build
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: '3.x'
+    - name: Install Poetry
       run: |
-        python -m pip install --upgrade pip
-        pip install setuptools wheel twine
-    - name: Build and publish
-      env:
-        TWINE_USERNAME: __token__
-        TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
+        curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
+    - name: Publish to PyPI
       run: |
-        python setup.py sdist bdist_wheel
-        twine upload dist/*
+        poetry config repositories.remote https://upload.pypi.org/legacy/
+        poetry --no-interaction -v publish --build --repository remote --username "__token__" --password "$PYPI_API_TOKEN"
+      env:
+        PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
 
   release:
-    needs: build
+    needs: publish
     runs-on: ubuntu-latest
     steps:
     - name: Create Release
diff --git a/setup.py b/setup.py
new file mode 100644
index 00000000..c983ab39
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,7 @@
+from setuptools import setup, find_packages
+
+setup(
+    name="semantic_router",
+    version="0.0.1",
+    packages=find_packages(),
+)
-- 
GitLab