diff --git a/.github/workflows/pr-build-extension.yaml b/.github/workflows/pr-build-extension.yaml new file mode 100644 index 0000000..5ad3df0 --- /dev/null +++ b/.github/workflows/pr-build-extension.yaml @@ -0,0 +1,49 @@ +# +# Copyright (C) 2025 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + + +name: pr-build-extension + +on: + pull_request: + branches: [ 'main' ] + +jobs: + build-extension: + name: Build OCI image + runs-on: ubuntu-24.04 + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set image env var + id: set-image + run: echo "IMAGE=ghcr.io/${{ github.repository_owner }}/podman-desktop-image-checker-openshift-ext:pr-${{ github.event.pull_request.number }}" >> "$GITHUB_ENV" + + - name: Build image with podman + shell: bash + run: | + echo "Building image ${IMAGE} with podman" + podman build -t "${IMAGE}" -f Containerfile . + podman save -m -o podman-desktop-image-checker-openshift-ext.tar "${IMAGE}" + echo "${IMAGE}" > podman-desktop-image-checker-openshift-ext.image + + - name: Upload extension oci flatten images + uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 # v4.6.2 + with: + name: podman-desktop-image-checker-openshift-ext + path: podman-desktop-image-checker-openshift-ext*