Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/bake_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,24 @@ jobs:
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
# main plus the latest and previous supported minor release branches.
# main plus the latest released patch of the latest and previous supported minors.
- name: Compute CNPG release matrix
id: versions
env:
# renovate: datasource=github-tags depName=cloudnative-pg/cloudnative-pg versioning=semver-coerced extractVersion=^v(?<version>\d+\.\d+)\.\d+$
LATEST_RELEASE: "1.30"
# renovate: datasource=github-tags depName=cloudnative-pg/cloudnative-pg versioning=semver-coerced extractVersion=^v(?<version>\d+\.\d+\.\d+)$
LATEST_RELEASE: "1.30.1"
run: |
PREVIOUS_RELEASE=$(awk -F. '{print $1"."$2-1}' <<< "$LATEST_RELEASE")
LATEST_MINOR="${LATEST_RELEASE%.*}"
PREVIOUS_MINOR=$(awk -F. '{print $1"."$2-1}' <<< "$LATEST_MINOR")
# Highest stable patch release of the previous minor
PREVIOUS_RELEASE=$(git ls-remote --tags --refs https://github.com/cloudnative-pg/cloudnative-pg "refs/tags/v${PREVIOUS_MINOR}.*" \
| sed 's|.*refs/tags/v||' \
| grep -E "^${PREVIOUS_MINOR//./\\.}\.[0-9]+$" \
| sort -V | tail -n1)
if [ -z "$PREVIOUS_RELEASE" ]; then
echo "No release found for CNPG ${PREVIOUS_MINOR}" >&2
exit 1
fi
versions=$(jq -cn --arg latest "$LATEST_RELEASE" --arg previous "$PREVIOUS_RELEASE" \
'["main", $previous, $latest]')
echo "versions=$versions" >> "$GITHUB_OUTPUT"
Expand Down
12 changes: 8 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ vars:
KIND_NODE_VERSION: v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
K8S_VERSION: '{{ regexReplaceAll "^v([0-9.]+).*" .KIND_NODE_VERSION "$1" }}'
KIND_CLUSTER_NAME: pg-extensions-{{ .K8S_VERSION }}
# renovate: datasource=github-tags depName=cloudnative-pg/cloudnative-pg versioning=semver-coerced extractVersion=^v(?<version>\d+\.\d+)\.\d+$
CNPG_RELEASE_DEFAULT: '1.30'
# renovate: datasource=github-tags depName=cloudnative-pg/cloudnative-pg versioning=semver-coerced extractVersion=^v(?<version>\d+\.\d+\.\d+)$
CNPG_RELEASE_DEFAULT: '1.30.1'

DOCKER_SOCKET:
sh: docker context inspect -f {{`'{{json .Endpoints.docker.Host}}'`}} $(docker context show)
Expand Down Expand Up @@ -308,10 +308,14 @@ tasks:
KUBECTL_VERSION: 1.37.1@sha256:b57b3bd3cd9f4f02dd444281857126aa78efa4b7b7e6ec57579dd927bf146fc3
CNPG_MANIFEST:
sh: |
if [ "{{ .CNPG_RELEASE }}" = "main" ]; then
release="{{ .CNPG_RELEASE }}"
if [ "${release}" = "main" ]; then
echo "https://raw.githubusercontent.com/cloudnative-pg/artifacts/main/manifests/operator-manifest.yaml"
elif echo "${release}" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-${release%.*}/releases/cnpg-${release}.yaml"
else
echo "https://raw.githubusercontent.com/cloudnative-pg/artifacts/release-{{ .CNPG_RELEASE }}/manifests/operator-manifest.yaml"
echo "CNPG_RELEASE must be 'main' or a full version like 1.30.1, got '${release}'" >&2
exit 1
fi
env:
_EXPERIMENTAL_DAGGER_RUNNER_HOST: container://{{ .DAGGER_ENGINE_NAME }}
Expand Down
Loading