diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 508009f82..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Release - -on: - push: - tags: - - 'v*' - -permissions: - contents: write - packages: write - -env: - DOCKERHUB_ORG: "keyval" - -jobs: - release: - runs-on: - labels: large-runner - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - run: git fetch --force --tags - - name: Set env - id: vars - run: | - echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - echo "short_commit=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_OUTPUT - echo "date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT - - uses: actions/setup-go@v4 - with: - go-version: '1.21.0' - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build Autoscaler Image - uses: docker/build-push-action@v5 - with: - push: true - tags: | - ghcr.io/keyval-dev/odigos/autoscaler:${{ steps.vars.outputs.tag }} - keyval/odigos-autoscaler:${{ steps.vars.outputs.tag }} - build-args: SERVICE_NAME=autoscaler - platforms: linux/amd64,linux/arm64 - - name: Build Scheduler Image - uses: docker/build-push-action@v5 - with: - push: true - tags: | - ghcr.io/keyval-dev/odigos/scheduler:${{ steps.vars.outputs.tag }} - keyval/odigos-scheduler:${{ steps.vars.outputs.tag }} - build-args: SERVICE_NAME=scheduler - platforms: linux/amd64,linux/arm64 - - name: Build Instrumentor Image - uses: docker/build-push-action@v5 - with: - push: true - tags: | - ghcr.io/keyval-dev/odigos/instrumentor:${{ steps.vars.outputs.tag }} - keyval/odigos-instrumentor:${{ steps.vars.outputs.tag }} - build-args: SERVICE_NAME=instrumentor - platforms: linux/amd64,linux/arm64 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Build Odiglet Image - uses: docker/build-push-action@v5 - with: - file: odiglet/Dockerfile - push: true - tags: | - ghcr.io/keyval-dev/odigos/odiglet:${{ steps.vars.outputs.tag }} - keyval/odigos-odiglet:${{ steps.vars.outputs.tag }} - platforms: linux/amd64,linux/arm64 - - uses: goreleaser/goreleaser-action@v5 - with: - distribution: goreleaser - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} - - - uses: ko-build/setup-ko@v0.6 - - - name: publish cli image to docker registries - working-directory: ./cli - env: - KO_DOCKER_REPO: ${{ env.DOCKERHUB_ORG }}/odigos-cli - KO_CONFIG_PATH: ./.ko.yaml - VERSION: ${{ steps.vars.outputs.tag }} - SHORT_COMMIT: ${{ steps.vars.outputs.short_commit }} - DATE: ${{ steps.vars.outputs.date }} - run: | - ko build --bare --tags latest --tags ${{ steps.vars.outputs.tag }} --platform=all . diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml new file mode 100644 index 000000000..0cba7a481 --- /dev/null +++ b/.github/workflows/publish-cli.yml @@ -0,0 +1,80 @@ +name: Release Odigos CLI + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag' + required: true + +permissions: + contents: write + packages: write + +env: + DOCKERHUB_ORG: "keyval" + +jobs: + release: + runs-on: + labels: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.tag }} + + - name: Set env + id: vars + run: | + # echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + echo "tag=${{github.event.inputs.tag}}" >> $GITHUB_OUTPUT + SHORT_COMMIT=$(git rev-parse --short HEAD) + echo "short_commit=${SHORT_COMMIT}" >> $GITHUB_ENV + echo "date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT + + - name: Verify Components Image Ready + run: | + declare -a REPOS=("odigos-autoscaler" "odigos-scheduler" "odigos-instrumentor" "odigos-odiglet" "odigos-enterprise-odiglet") + TAG_TO_CHECK=${{ steps.vars.outputs.tag }} + + for REPO in "${REPOS[@]}"; do + echo "Checking tag $TAG_TO_CHECK in $REPO..." + TAGS_JSON=$(curl -s "https://hub.docker.com/v2/repositories/${{ env.DOCKERHUB_ORG }}/$REPO/tags/") + if echo "$TAGS_JSON" | grep -q "\"name\":\"$TAG_TO_CHECK\""; then + echo "Tag $TAG_TO_CHECK exists in Docker Hub repository $REPO." + else + echo "Tag $TAG_TO_CHECK does not exist in Docker Hub repository $REPO." + exit 1 + fi + done + + - uses: actions/setup-go@v4 + with: + go-version: '1.21.0' + + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} + + - uses: ko-build/setup-ko@v0.6 + + - name: publish cli image to docker registries + working-directory: ./cli + env: + KO_DOCKER_REPO: ${{ env.DOCKERHUB_ORG }}/odigos-cli + KO_CONFIG_PATH: ./.ko.yaml + VERSION: ${{ steps.vars.outputs.tag }} + SHORT_COMMIT: ${{ steps.vars.outputs.short_commit }} + DATE: ${{ steps.vars.outputs.date }} + run: | + ko build --bare --tags latest --tags ${{ steps.vars.outputs.tag }} --platform=all . diff --git a/.github/workflows/publish-modules.yml b/.github/workflows/publish-modules.yml index c1eade14e..c816835c5 100644 --- a/.github/workflows/publish-modules.yml +++ b/.github/workflows/publish-modules.yml @@ -7,7 +7,7 @@ on: jobs: tag-modules: - runs-on: ubuntu-latest + runs-on: large-runner steps: - name: Checkout repository uses: actions/checkout@v4 @@ -33,4 +33,57 @@ jobs: - name: Push Module Tags run: | git push origin --tags + + publish-docker-images: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Extract Tag + id: extract_tag + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build Autoscaler Image + uses: docker/build-push-action@v5 + with: + push: true + tags: | + keyval/odigos-autoscaler:${{ steps.vars.outputs.tag }} + build-args: SERVICE_NAME=autoscaler + platforms: linux/amd64,linux/arm64 + + - name: Build Scheduler Image + uses: docker/build-push-action@v5 + with: + push: true + tags: | + keyval/odigos-scheduler:${{ steps.vars.outputs.tag }} + build-args: SERVICE_NAME=scheduler + platforms: linux/amd64,linux/arm64 + + - name: Build Instrumentor Image + uses: docker/build-push-action@v5 + with: + push: true + tags: | + keyval/odigos-instrumentor:${{ steps.vars.outputs.tag }} + build-args: SERVICE_NAME=instrumentor + platforms: linux/amd64,linux/arm64 + - name: Build Odiglet Image + uses: docker/build-push-action@v5 + with: + file: odiglet/Dockerfile + push: true + tags: | + keyval/odigos-odiglet:${{ steps.vars.outputs.tag }} + platforms: linux/amd64,linux/arm64