From 0c0800093b9dcb209a794cf9930ffcaea28229ca Mon Sep 17 00:00:00 2001 From: Bam4d Date: Thu, 7 Dec 2023 18:06:02 +0100 Subject: [PATCH] some minor fixes --- .github/workflows/build_publish.yaml | 34 +++++++++++++++++++++++++--- pyproject.toml | 2 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_publish.yaml b/.github/workflows/build_publish.yaml index 65dabee..5ce50f0 100644 --- a/.github/workflows/build_publish.yaml +++ b/.github/workflows/build_publish.yaml @@ -7,8 +7,8 @@ on: # We only deploy on tags and main branch tags: # Only run on tags that match the following regex - # This will match tags like v1.0.0, v1.0.1, etc. - - v[0-9]+.[0-9]+.[0-9]+ + # This will match tags like 1.0.0, 1.0.1, etc. + - "[0-9]+.[0-9]+.[0-9]+" # Build on pull requests pull_request: @@ -43,4 +43,32 @@ jobs: # Mypy - name: Mypy Check run: | - poetry run mypy . \ No newline at end of file + poetry run mypy . + + publish: + if: startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + needs: lint + steps: + + # Checkout the repository + - name: Checkout + uses: actions/checkout@v4 + + # Set python version to 3.11 + - name: set python version + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + # build package using poetry + - name: Build Package + run: | + poetry version ${{ github.ref }} + poetry build + + # Publish to PyPi + - name: Pypi publish (prod) + run: | + poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} + poetry publish \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d5a3828..89e68b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mistralai" -version = "0.1.0" +version = "0.0.1" description = "" authors = ["Bam4d "] readme = "README.md"