From 8a39222e37d4d8a6ebeb0f24dd11ba0159710061 Mon Sep 17 00:00:00 2001 From: Alejandro Moreo Date: Mon, 6 Oct 2025 14:29:27 +0200 Subject: [PATCH] updated ci for pip release --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe752d8..cd18e37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,8 @@ on: branches: - master - devel + tags: + - "[0-9]+.[0-9]+.[0-9]+" jobs: @@ -66,3 +68,37 @@ jobs: branch: gh-pages directory: __gh-pages/ github_token: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Build & Publish Release + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install build dependencies + run: | + python -m pip install --upgrade pip build twine + - name: Build package + run: python -m build + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + body: | + Changes in this release: + - see commit history for details + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file