From 23953e2bd101dc72983d9d70d330b60df484d406 Mon Sep 17 00:00:00 2001 From: venkatnsrinivasan Date: Mon, 30 Jan 2023 12:53:36 -0800 Subject: [PATCH] Added support for bulding arm images with rpi support Signed-off-by: venkatnsrinivasan --- .github/workflows/publish-arm.yaml | 43 +++++++++++++++++++++++++++++ .github/workflows/publish.yaml | 4 +-- .github/workflows/pull_request.yaml | 2 +- Earthfile | 7 +++-- 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish-arm.yaml diff --git a/.github/workflows/publish-arm.yaml b/.github/workflows/publish-arm.yaml new file mode 100644 index 0000000..9dbc140 --- /dev/null +++ b/.github/workflows/publish-arm.yaml @@ -0,0 +1,43 @@ +name: Publish + +on: + push: + tags: + - v* + +jobs: + images: + runs-on: ubuntu-latest + permissions: + id-token: write + strategy: + matrix: + base-image: + - quay.io/kairos/core-opensuse-arm-rpi:v1.4.0 + k3s-version: + - v1.25.2+k3s1 + - v1.25.0+k3s1 + - v1.24.6+k3s1 + - v1.24.4+k3s1 + - v1.23.12+k3s1 + - v1.23.10+k3s1 + - v1.22.15+k3s1 + - v1.22.13+k3s1 + env: + REGISTRY: quay.io + REGISTRY_USER: ${{ secrets.QUAY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@master + - uses: sigstore/cosign-installer@main + - uses: docker/setup-buildx-action@master + - uses: earthly/actions-setup@v1 + with: + version: "latest" + - run: echo $REGISTRY_PASSWORD | docker login -u $REGISTRY_USER --password-stdin $REGISTRY + - run: env | grep ACTIONS_ID_TOKEN_REQUEST > .env + - run: env | grep REGISTRY >> .env + - run: earthly --ci --push +docker-arm64-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} + - run: earthly --ci +cosign-arm64-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} + diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2fc1272..67b88aa 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -38,6 +38,6 @@ jobs: - run: echo $REGISTRY_PASSWORD | docker login -u $REGISTRY_USER --password-stdin $REGISTRY - run: env | grep ACTIONS_ID_TOKEN_REQUEST > .env - run: env | grep REGISTRY >> .env - - run: earthly --ci --push +docker-all-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} - - run: earthly --ci +cosign-all-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} + - run: earthly --ci --push +docker-amd64-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} + - run: earthly --ci +cosign-amd64-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 0538b33..e5dd710 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -37,4 +37,4 @@ jobs: - uses: earthly/actions-setup@v1 with: version: "latest" - - run: earthly --ci +docker-all-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} + - run: earthly --ci +docker-amd64-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} diff --git a/Earthfile b/Earthfile index 4d15a75..68b17e3 100644 --- a/Earthfile +++ b/Earthfile @@ -117,10 +117,11 @@ cosign: RUN cosign sign $IMAGE_REPOSITORY/${BASE_IMAGE_NAME}-k3s:${K3S_VERSION_TAG} RUN cosign sign $IMAGE_REPOSITORY/${BASE_IMAGE_NAME}-k3s:${K3S_VERSION_TAG}_${VERSION} -docker-all-platforms: +docker-amd64-platforms: BUILD --platform=linux/amd64 +docker +docker-arm64-platforms: BUILD --platform=linux/arm64 +docker - -cosign-all-platforms: +cosign-amd64-platforms: BUILD --platform=linux/amd64 +cosign +cosign-arm64-platforms: BUILD --platform=linux/arm64 +cosign