docs: record v05 fork validation branch #6
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: Build and Push Release Images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*.*.*" | |
| - "v*.*.*-*" # Support for pre-release tags like v1.2.3-alpha | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.24.4" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Set up yq | |
| run: | | |
| sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 | |
| sudo chmod +x /usr/local/bin/yq | |
| - name: Determine release metadata | |
| run: | | |
| echo "REPOSITORY_OWNER_LOWER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" | |
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
| echo "TAG=${{ github.ref_name }}" >> "$GITHUB_ENV" | |
| else | |
| echo "TAG=latest" >> "$GITHUB_ENV" | |
| fi | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push images | |
| env: | |
| IMAGE_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER_LOWER }} | |
| run: | | |
| make docker-buildx-push IMAGE_REGISTRY="${IMAGE_REGISTRY}" WORKLOAD_MANAGER_IMAGE="workloadmanager:${TAG}" | |
| make docker-buildx-push-router IMAGE_REGISTRY="${IMAGE_REGISTRY}" ROUTER_IMAGE="agentcube-router:${TAG}" | |
| make docker-buildx-push-picod IMAGE_REGISTRY="${IMAGE_REGISTRY}" PICOD_IMAGE="picod:${TAG}" | |
| - name: Login Helm to GitHub Container Registry | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u "${{ github.actor }}" --password-stdin | |
| - name: Package Helm chart | |
| env: | |
| CHART_PATH: manifests/charts/base | |
| IMAGE_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER_LOWER }} | |
| run: | | |
| yq e -i '.version = env(TAG) | .appVersion = env(TAG)' "${CHART_PATH}/Chart.yaml" | |
| yq e -i ' | |
| .router.image.repository = env(IMAGE_REGISTRY) + "/agentcube-router" | | |
| .router.image.tag = env(TAG) | | |
| .workloadmanager.image.repository = env(IMAGE_REGISTRY) + "/workloadmanager" | | |
| .workloadmanager.image.tag = env(TAG) | |
| ' "${CHART_PATH}/values.yaml" | |
| helm package "${CHART_PATH}" --version "${TAG}" --app-version "${TAG}" | |
| - name: Push Helm chart | |
| run: | | |
| helm push "agentcube-${TAG}.tgz" "oci://ghcr.io/${REPOSITORY_OWNER_LOWER}/charts" |