Workflow file for this run
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 Robusta-CLI | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }} | |
| RELEASE_VER : ${{ github.event.release.tag_name }} | |
| jobs: | |
| setup-build-publish-deploy: | |
| name: Build images | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: 'read' | |
| id-token: 'write' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get release version | |
| run: echo "$RELEASE_VER" | |
| - uses: google-github-actions/auth@v2 | |
| with: | |
| project_id: 'genuine-flight-317411' | |
| workload_identity_provider: 'projects/429189597230/locations/global/workloadIdentityPools/github/providers/robusta-repos' # prod | |
| - name: Set up gcloud CLI | |
| uses: google-github-actions/setup-gcloud@v2 | |
| with: | |
| project_id: genuine-flight-317411 | |
| - name: Configure Docker Registry | |
| run: gcloud auth configure-docker us-central1-docker.pkg.dev | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Update package version | |
| run: | | |
| sed -i 's/0.0.0/${{env.RELEASE_VER}}/g' robusta_cli/_version.py pyproject.toml | |
| # Set up the buildx to run build for multiple platforms | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@c5ffa2a61740d9877bd1f40899a87c8ec93b0d9f | |
| - name: Docker Setup Buildx | |
| uses: docker/setup-buildx-action@bea6a01aa40b4d58b0382d47e1c4a70137af67b1 | |
| with: | |
| config-inline: | | |
| [worker.oci] | |
| enabled = true | |
| platforms = [ "linux/amd64", "linux/arm64" ] | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.12 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install twine # TODO is twine needed? | |
| - name: Prepare pypi dist | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - --version 1.8.2 | |
| poetry config virtualenvs.create false | |
| poetry install --no-dev | |
| poetry publish --build -u __token__ -p ${{ secrets.PYPI_PROJECT_TOKEN }} | |
| - name: Release Docker CLI | |
| if: "!github.event.release.prerelease" | |
| run: |- | |
| docker buildx build \ | |
| --platform linux/arm64,linux/amd64 \ | |
| --tag us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli:${{env.RELEASE_VER}} \ | |
| --tag robustadev/robusta-cli:${{env.RELEASE_VER}} \ | |
| --tag us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli \ | |
| --push \ | |
| --file Dockerfile \ | |
| . | |
| - name: Build Alpha Docker CLI | |
| if: "github.event.release.prerelease" | |
| run: |- | |
| docker buildx build \ | |
| --platform linux/arm64,linux/amd64 \ | |
| --tag us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli:${{env.RELEASE_VER}} \ | |
| --push \ | |
| --file Dockerfile \ | |
| . |