Release new version #1512
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Release new version" | |
| on: | |
| workflow_run: | |
| workflows: | |
| - "CI Tests" | |
| branches: | |
| - master | |
| types: | |
| - completed | |
| jobs: | |
| docker: | |
| name: "Build Docker container" | |
| runs-on: ubuntu-24.04 | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: docker/setup-qemu-action@v4 | |
| - uses: docker/setup-buildx-action@v4 | |
| - uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.16" | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: "Install StreamFlow" | |
| run: uv sync --locked --no-dev | |
| - name: "Get StreamFlow version" | |
| run: | | |
| source .venv/bin/activate | |
| echo "STREAMFLOW_VERSION=$(python -c "from streamflow.version import VERSION; print(VERSION)")" >> $GITHUB_ENV | |
| - name: "Check if Docker image already exists" | |
| run: echo "NEW_IMAGE=$(docker buildx imagetools inspect alphaunito/streamflow:${STREAMFLOW_VERSION} > /dev/null 2>&1; echo $?)" >> $GITHUB_ENV | |
| - name: "Build Docker image" | |
| if: ${{ env.NEW_IMAGE == 1 }} | |
| uses: docker/build-push-action@v7 | |
| with: | |
| build-args: | | |
| HELM_VERSION=v3.19.0 | |
| push: true | |
| tags: | | |
| alphaunito/streamflow:${{ env.STREAMFLOW_VERSION }} | |
| alphaunito/streamflow:latest | |
| github: | |
| name: "Create GitHub Release" | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.16" | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: "Install StreamFlow" | |
| run: uv sync --locked --no-dev | |
| - name: "Get StreamFlow version" | |
| run: | | |
| source .venv/bin/activate | |
| echo "STREAMFLOW_VERSION=$(python -c "from streamflow.version import VERSION; print(VERSION)")" >> $GITHUB_ENV | |
| - name: "Check tag existence" | |
| uses: mukunku/tag-exists-action@v1.7.0 | |
| id: check-tag | |
| with: | |
| tag: ${{ env.STREAMFLOW_VERSION }} | |
| - name: "Create Release" | |
| id: create-release | |
| uses: actions/create-release@v1 | |
| if: ${{ steps.check-tag.outputs.exists == 'false' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.STREAMFLOW_VERSION }} | |
| release_name: ${{ env.STREAMFLOW_VERSION }} | |
| draft: false | |
| prerelease: false | |
| pypi: | |
| name: "Publish on PyPI" | |
| runs-on: ubuntu-24.04 | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/streamflow | |
| permissions: | |
| id-token: write | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.16" | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: "Install StreamFlow" | |
| run: uv sync --locked --no-dev | |
| - name: "Get StreamFlow version" | |
| run: | | |
| source .venv/bin/activate | |
| echo "STREAMFLOW_VERSION=$(python -c "from streamflow.version import VERSION; print(VERSION)")" >> $GITHUB_ENV | |
| - name: "Get PyPI version" | |
| run: echo "PYPI_VERSION=$(pip index versions --pre streamflow | grep streamflow | sed 's/.*(\(.*\))/\1/')" >> $GITHUB_ENV | |
| - name: "Build Python packages" | |
| if: ${{ env.STREAMFLOW_VERSION != env.PYPI_VERSION }} | |
| run: | | |
| python -m pip install build --user | |
| python -m build --sdist --wheel --outdir dist/ . | |
| - name: "Publish package to PyPI" | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| if: ${{ env.STREAMFLOW_VERSION != env.PYPI_VERSION }} |