forked from confidential-containers/cloud-api-adaptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Cohere release #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yousef-cohere
merged 9 commits into
feat/gcp-workload-identity-federation
from
cohere-release
Apr 22, 2026
Merged
Cohere release #21
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
25ef22d
feat: update GitHub workflows for Cohere release process
yousef-cohere ebe7995
refactor: streamline output redirection in publish-cohere-release wor…
yousef-cohere 89e699e
fix: update chart version format in publish-cohere workflow
yousef-cohere 8798c75
chore: update peerpod-ctrl image build process in GitHub workflows
yousef-cohere d46a84d
chore: update GOFLAGS for peerpod-ctrl image build in workflows
yousef-cohere d34bcd8
chore: enhance Helm chart publishing workflow for peerpods
yousef-cohere baec505
fix: add error handling for digest extraction in Helm chart publishin…
yousef-cohere 1826b0a
chore: standardize yq installation in workflows
yousef-cohere f3711c3
chore: simplify branch triggers in publish-cohere workflow
yousef-cohere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,270 @@ | ||
| --- | ||
| # Publish semver-tagged Cohere-fork release artifacts to GHCR. | ||
| # | ||
| # Triggered by GitHub Releases targeting the `cohere` branch. The release tag | ||
| # becomes the image/chart tag verbatim, with one normalisation: a leading "v" | ||
| # is stripped for the chart (Helm/OCI requires SemVer with no prefix). | ||
| # | ||
| # Release process: | ||
| # 1. Bump src/cloud-api-adaptor/install/charts/peerpods/Chart.yaml `version` | ||
| # to the new SemVer (e.g. 0.1.4-cohere.2). Merge to cohere. | ||
| # 2. Create a GitHub Release on the cohere branch with tag `v0.1.4-cohere.2` | ||
| # (or `0.1.4-cohere.2` — both work). Publishing the release fires this. | ||
| # | ||
| # Tags produced (release `v0.1.4-cohere.2`): | ||
| # ghcr.io/cohere-ai/cloud-api-adaptor/cloud-api-adaptor:v0.1.4-cohere.2 | ||
| # ghcr.io/cohere-ai/cloud-api-adaptor/peerpod-ctrl:v0.1.4-cohere.2 | ||
| # ghcr.io/cohere-ai/cloud-api-adaptor/charts/peerpods:0.1.4-cohere.2 | ||
| # | ||
| # The chart is self-contained: values.yaml is patched at package time so | ||
| # image.tag and resourceCtrl.image.tag default to the release tag. A bare | ||
| # `helm install` without overrides gets matching images. | ||
| # | ||
| # `latest-cohere` is NOT touched — that floats with the cohere branch tip via | ||
| # publish-cohere.yaml. Consumers pin to the semver tag for stable releases. | ||
| name: Publish (cohere release) | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: 'Release tag to (re)publish (e.g. v0.1.4-cohere.2). Must already exist as a git tag on cohere.' | ||
| required: true | ||
| type: string | ||
|
|
||
| concurrency: | ||
| group: publish-cohere-release-${{ github.event.release.tag_name || inputs.tag }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: {} | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io/cohere-ai/cloud-api-adaptor | ||
|
|
||
| jobs: | ||
| tags: | ||
| name: Compute tags | ||
| runs-on: ubuntu-24.04 | ||
| # Only fire for releases cut from the cohere branch. Manual dispatch always runs. | ||
| if: >- | ||
| github.event_name == 'workflow_dispatch' || | ||
| github.event.release.target_commitish == 'cohere' | ||
| outputs: | ||
| git_ref: ${{ steps.t.outputs.git_ref }} | ||
| image_tag: ${{ steps.t.outputs.image_tag }} | ||
| chart_version: ${{ steps.t.outputs.chart_version }} | ||
| steps: | ||
| - name: Derive tags from release | ||
| id: t | ||
| env: | ||
| RAW_TAG: ${{ github.event.release.tag_name || inputs.tag }} | ||
| run: | | ||
| # Image tags keep the v prefix verbatim; chart strips it (OCI SemVer). | ||
| chart_version="${RAW_TAG#v}" | ||
| { | ||
| echo "git_ref=${RAW_TAG}" | ||
| echo "image_tag=${RAW_TAG}" | ||
| echo "chart_version=${chart_version}" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| caa: | ||
| name: Build CAA image (release, amd64) | ||
| needs: tags | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read # checkout the release tag | ||
| packages: write # push image manifests to GHCR | ||
| defaults: | ||
| run: | ||
| working-directory: src/cloud-api-adaptor | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| ref: ${{ needs.tags.outputs.git_ref }} | ||
|
|
||
| - name: Read Go version from versions.yaml | ||
| run: | | ||
| command -v yq || sudo snap install yq | ||
| go_version="$(yq '.tools.golang' versions.yaml)" | ||
| [ -n "$go_version" ] | ||
| echo "GO_VERSION=${go_version}" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Setup Go ${{ env.GO_VERSION }} | ||
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||
| with: | ||
| go-version: ${{ env.GO_VERSION }} | ||
| cache-dependency-path: "**/go.sum" | ||
| cache: false | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push release image | ||
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | ||
| env: | ||
| REGISTRY: ${{ env.REGISTRY }} | ||
| RELEASE_TAGS: ${{ needs.tags.outputs.image_tag }} | ||
| with: | ||
| timeout_minutes: 60 | ||
| retry_wait_seconds: 120 | ||
| max_attempts: 3 | ||
| command: | | ||
| cd src/cloud-api-adaptor && \ | ||
| ARCHES=linux/amd64 \ | ||
| RELEASE_BUILD=true \ | ||
| RELEASE_TAGS="${RELEASE_TAGS}" \ | ||
| make image registry="${REGISTRY}" | ||
|
|
||
| peerpod-ctrl: | ||
| name: Build peerpod-ctrl image (amd64) | ||
| needs: tags | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read # checkout the release tag | ||
| packages: write # push image manifests to GHCR | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| ref: ${{ needs.tags.outputs.git_ref }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | ||
| with: | ||
| tags: ${{ env.REGISTRY }}/peerpod-ctrl:${{ needs.tags.outputs.image_tag }} | ||
| push: true | ||
| context: src | ||
| file: src/peerpod-ctrl/Dockerfile | ||
| platforms: linux/amd64 | ||
| build-args: | | ||
| GOFLAGS=-tags=gcp | ||
|
|
||
| chart: | ||
| name: Publish peerpods Helm chart | ||
| needs: tags | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read # checkout the release tag | ||
| packages: write # push chart artifact to GHCR | ||
| id-token: write # OIDC token for actions/attest sigstore signing | ||
| attestations: write # write build provenance attestations | ||
| artifact-metadata: write # actions/attest writes attestation metadata | ||
| defaults: | ||
| run: | ||
| working-directory: src/cloud-api-adaptor/install/charts/peerpods | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ needs.tags.outputs.git_ref }} | ||
| persist-credentials: false | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install yq | ||
| run: | | ||
| sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 | ||
| sudo chmod +x /usr/local/bin/yq | ||
|
|
||
| - name: Patch values.yaml with release image tags | ||
| env: | ||
| IMAGE_TAG: ${{ needs.tags.outputs.image_tag }} | ||
| run: | | ||
| yq -i ".image.tag = \"${IMAGE_TAG}\"" values.yaml | ||
| yq -i ".resourceCtrl.image.tag = \"${IMAGE_TAG}\"" values.yaml | ||
| echo "Patched values.yaml default image tags to ${IMAGE_TAG}" | ||
| echo " image.tag: $(yq '.image.tag' values.yaml)" | ||
| echo " resourceCtrl.image.tag: $(yq '.resourceCtrl.image.tag' values.yaml)" | ||
|
|
||
| - name: Read versions | ||
| id: read_version | ||
| working-directory: . | ||
| env: | ||
| CHART_VERSION: ${{ needs.tags.outputs.chart_version }} | ||
| run: | | ||
| HELM_VERSION="$(yq -e '.tools.helm.version' src/cloud-api-adaptor/versions.yaml)" | ||
| HELM_CHECKSUM="$(yq -e '.tools.helm.sha256' src/cloud-api-adaptor/versions.yaml)" | ||
| { | ||
| echo "helm_version=${HELM_VERSION}" | ||
| echo "helm_checksum=${HELM_CHECKSUM}" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install Helm | ||
| env: | ||
| HELM_VERSION: ${{ steps.read_version.outputs.helm_version }} | ||
| HELM_CHECKSUM: ${{ steps.read_version.outputs.helm_checksum }} | ||
| run: | | ||
| curl -fsSL -o helm.tar.gz "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz" | ||
| echo "${HELM_CHECKSUM} helm.tar.gz" | sha256sum --check --strict | ||
| tar -xzf helm.tar.gz | ||
| sudo mv linux-amd64/helm /usr/local/bin/helm | ||
| rm -rf helm.tar.gz linux-amd64 | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Authenticate Helm with GHCR | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_ACTOR: ${{ github.actor }} | ||
| run: | | ||
| echo "${GITHUB_TOKEN}" | helm registry login ghcr.io \ | ||
| --username "${GITHUB_ACTOR}" \ | ||
| --password-stdin | ||
|
|
||
| - name: Update Helm dependencies | ||
| run: helm dependency update | ||
|
|
||
| - name: Package Helm chart | ||
| env: | ||
| VERSION: ${{ needs.tags.outputs.chart_version }} | ||
| run: | | ||
| mkdir -p .cr-release-packages | ||
| helm package . --version "${VERSION}" --destination .cr-release-packages | ||
| ls -lh .cr-release-packages/ | ||
|
|
||
| - name: Push Helm chart to OCI registry | ||
| id: push_chart | ||
| env: | ||
| VERSION: ${{ needs.tags.outputs.chart_version }} | ||
| REGISTRY: ${{ env.REGISTRY }}/charts | ||
| run: | | ||
| CHART_PACKAGE=".cr-release-packages/peerpods-${VERSION}.tgz" | ||
| helm push "${CHART_PACKAGE}" "oci://${REGISTRY}" | ||
| DIGEST=$(helm show chart "oci://${REGISTRY}/peerpods" --version "${VERSION}" 2>&1 | awk '/Digest:/ {print $2}') | ||
| echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT" | ||
| echo "Pushed: oci://${REGISTRY}/peerpods:${VERSION} (digest: ${DIGEST})" | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Generate attestation | ||
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | ||
| with: | ||
| subject-name: ${{ env.REGISTRY }}/charts/peerpods | ||
| subject-digest: ${{ steps.push_chart.outputs.digest }} | ||
| push-to-registry: true | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.