diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index ddae444..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Publish Package to Python Package Index - -on: - push: - paths-ignore: - - .github/** - branches: - - main - -jobs: - publish: - name: Publish - runs-on: ubuntu-latest - steps: - - name: 🔨 Checkout - uses: actions/checkout@v3 - - - name: 🔨 Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: 🔨 Setup Dependencies - run: | - python -m pip install poetry - poetry install - poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} - - - name: 📦 Build - run: poetry build - - - name: 🎉 Publish - run: poetry publish diff --git a/.github/workflows/python-sdk-ci.yaml b/.github/workflows/python-sdk-ci.yaml new file mode 100644 index 0000000..489a102 --- /dev/null +++ b/.github/workflows/python-sdk-ci.yaml @@ -0,0 +1,42 @@ +name: python-sdk-ci + +on: + push: + branches: [ main ] + tags: + - '*' + pull_request: + branches: [ main ] + +permissions: + contents: write + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Setup Dependencies + run: | + python -m pip install poetry + poetry install + poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} + + - name: Build + run: poetry build + + - name: Publish + if: startsWith(github.ref, 'refs/tags/') + run: poetry publish + + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1