Skip to content

fix: add PCSG topology constraints to scaled PodGangs (#347) #116

fix: add PCSG topology constraints to scaled PodGangs (#347)

fix: add PCSG topology constraints to scaled PodGangs (#347) #116

# /*
# Copyright 2025 The Grove Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# */
name: Build and Publish Artifacts
on:
push:
branches:
- "main"
tags:
- '*.*.*'
permissions:
contents: read
packages: write
jobs:
build-and-push:
name: Build & Push
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Extract package version from tag
if: startsWith(github.ref, 'refs/tags/')
run: |
PACKAGE_VERSION=${GITHUB_REF_NAME}
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo $PACKAGE_VERSION
- name: Extract package version from branch commit
if: startsWith(github.ref, 'refs/heads/')
run: |
# We add a 'g' prefix to the hash.
# This prevents "all-number" hashes starting with 0 from breaking Helm (invalid semver)
PACKAGE_VERSION=v0.0.0-g$(git rev-parse --short HEAD)
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo $PACKAGE_VERSION
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set Docker Registry
run: |
DOCKER_REGISTRY=$(echo 'ghcr.io/${{ github.repository }}' | tr '[:upper:]' '[:lower:]')
echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" >> $GITHUB_ENV
- name: Docker build & push
run: |
make --directory=operator docker-build PLATFORM=linux/amd64,linux/arm64 VERSION=$PACKAGE_VERSION REGISTRY=$DOCKER_REGISTRY DOCKER_BUILD_ADDITIONAL_ARGS=--push
- name: Copy CRDs to charts
run: |
./operator/hack/prepare-charts.sh
- name: Build Helm chart
run: |
sed -i "s#repository: grove-operator#repository: $DOCKER_REGISTRY/grove-operator#" operator/charts/values.yaml
sed -i "s#tag:.*#tag: $PACKAGE_VERSION#" operator/charts/values.yaml
sed -i "s#value: grove-initc#value: $DOCKER_REGISTRY/grove-initc#" operator/charts/values.yaml
helm package ./operator/charts --app-version $PACKAGE_VERSION --version $PACKAGE_VERSION
- name: Push Helm Chart
run: |
helm push ./grove-charts-$PACKAGE_VERSION.tgz oci://$DOCKER_REGISTRY