diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..75ccf13 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,45 @@ +name: Publish + +on: + release: + types: [published] + +env: + POETRY_VERSION: "1.8.3" + PACKAGE_NAME: "datalogs" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Poetry + run: pipx install poetry==${{ env.POETRY_VERSION }} + + - name: Build package + run: poetry build + + - name: Upload package artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PACKAGE_NAME }}-release + path: dist + + publish: + needs: build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/${{ env.PACKAGE_NAME }} + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: ${{ env.PACKAGE_NAME }}-release + path: dist + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1