Skip to content

Commit

Permalink
Add platforms and remove matrix
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Savian <[email protected]>
  • Loading branch information
vitorsavian committed Oct 2, 2024
1 parent 0360200 commit ed2e59b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ permissions:
jobs:
publish-rke2-upgrade:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ linux ]
arch: [ amd64, arm64 ]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -22,13 +17,19 @@ jobs:
run: |
echo "GIT_TAG=$(echo "${{ github.ref_name }}" | sed -e 's/+/-/g')" >> "$GITHUB_ENV"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
- name: Login to Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -42,7 +43,6 @@ jobs:
push: true
tags: rancher/rke2-upgrade:${{ env.GIT_TAG }}
file: Dockerfile
platforms: ${{ matrix.os }}/${{ matrix.arch }}
platforms: linux/amd64, linux/arm64
build-args: |
TAG=${{ github.ref_name }}
ARCH=${{ matrix.arch }}
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
ARG ALPINE=alpine:3.18
ARG ALPINE=alpine:3.20
FROM ${ALPINE} AS verify
ARG ARCH
ARG TARGETARCH
ARG TAG
WORKDIR /verify
ADD https://github.com/rancher/rke2/releases/download/${TAG}/sha256sum-${ARCH}.txt .
ADD https://github.com/rancher/rke2/releases/download/${TAG}/sha256sum-${TARGETARCH}.txt .
RUN set -x \
&& apk --no-cache add \
curl \
file
RUN export ARTIFACT="rke2.linux-${ARCH}" \
RUN export ARTIFACT="rke2.linux-${TARGETARCH}" \
&& curl --output ${ARTIFACT} --fail --location https://github.com/rancher/rke2/releases/download/${TAG}/${ARTIFACT} \
&& grep "rke2.linux-${ARCH}$" sha256sum-${ARCH}.txt | sha256sum -c \
&& grep "rke2.linux-${TARGETARCH}$" sha256sum-${TARGETARCH}.txt | sha256sum -c \
&& mv -vf ${ARTIFACT} /opt/rke2 \
&& chmod +x /opt/rke2 \
&& file /opt/rke2

RUN set -x \
&& apk --no-cache add curl \
&& export K8S_RELEASE=$(echo ${TAG} | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+') \
&& curl -fsSLO https://cdn.dl.k8s.io/release/${K8S_RELEASE}/bin/linux/${ARCH}/kubectl \
&& curl -fsSLO https://cdn.dl.k8s.io/release/${K8S_RELEASE}/bin/linux/${TARGETARCH}/kubectl \
&& chmod +x kubectl

FROM ${ALPINE}
Expand Down

0 comments on commit ed2e59b

Please sign in to comment.