fix(ci): replace OS and ARCH

The following patch replaces ${OS} and ${ARCH} with a static value `linux` and
the command `dpkg --print-architecture`.
This commit is contained in:
Markus Pesch 2025-06-16 09:34:30 +02:00
parent de74eab00e
commit 2b1979b43c
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982

View File

@ -13,18 +13,6 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Determine Architecture and Operating System to support x86_64 and ARM based CI nodes
run: |
# determine operating system
OS=$(uname | tr '[:upper:]' '[:lower:]')
echo "OS=${OS}" >> $GITHUB_ENV
echo "INFO: Set environment variable OS=${OS}"
# determine architecture
ARCH="$(dpkg --print-architecture)"
echo "ARCH=${ARCH}" >> $GITHUB_ENV
echo "INFO: Set environment variable ARCH=${ARCH}"
- name: Install packages via apt - name: Install packages via apt
run: | run: |
apt update --yes apt update --yes
@ -35,18 +23,18 @@ jobs:
# renovate: datasource=docker depName=alpine/helm # renovate: datasource=docker depName=alpine/helm
HELM_VERSION: "3.18.2" HELM_VERSION: "3.18.2"
run: | run: |
curl --fail --location --output /dev/stdout --silent --show-error https://get.helm.sh/helm-v${HELM_VERSION}-${OS}-${ARCH}.tar.gz | tar --extract --gzip --file /dev/stdin curl --fail --location --output /dev/stdout --silent --show-error https://get.helm.sh/helm-v${HELM_VERSION}-linux-$(dpkg --print-architecture).tar.gz | tar --extract --gzip --file /dev/stdin
mv ${OS}-${ARCH}/helm /usr/local/bin/ mv linux-$(dpkg --print-architecture)/helm /usr/local/bin/
rm --force --recursive ${OS}-${ARCH} helm-v${HELM_VERSION}-${OS}-${ARCH}.tar.gz rm --force --recursive linux-$(dpkg --print-architecture) helm-v${HELM_VERSION}-linux-$(dpkg --print-architecture).tar.gz
helm version helm version
- name: Install yq - name: Install yq
env: env:
YQ_VERSION: v4.45.4 # renovate: datasource=github-releases depName=mikefarah/yq YQ_VERSION: v4.45.4 # renovate: datasource=github-releases depName=mikefarah/yq
run: | run: |
curl --fail --location --output /dev/stdout --silent --show-error https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_${OS}_${ARCH}.tar.gz | tar --extract --gzip --file /dev/stdin curl --fail --location --output /dev/stdout --silent --show-error https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_$(dpkg --print-architecture).tar.gz | tar --extract --gzip --file /dev/stdin
mv yq_${OS}_${ARCH} /usr/local/bin mv yq_linux_$(dpkg --print-architecture) /usr/local/bin
rm --force --recursive yq_${OS}_${ARCH} yq_${OS}_${ARCH}.tar.gz rm --force --recursive yq_linux_$(dpkg --print-architecture) yq_linux_$(dpkg --print-architecture).tar.gz
yq --version yq --version
- name: Install docker-ce via apt - name: Install docker-ce via apt
@ -54,7 +42,7 @@ jobs:
install -m 0755 -d /etc/apt/keyrings install -m 0755 -d /etc/apt/keyrings
curl --fail --location --silent --show-error https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg curl --fail --location --silent --show-error https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="${ARCH}" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update --yes apt update --yes
apt install --yes python3 python3-pip apt-transport-https docker-ce-cli apt install --yes python3 python3-pip apt-transport-https docker-ce-cli