diff --git a/.github/workflows/flow-release-legacy-images.yaml b/.github/workflows/flow-release-legacy-images.yaml new file mode 100644 index 0000000..097226c --- /dev/null +++ b/.github/workflows/flow-release-legacy-images.yaml @@ -0,0 +1,103 @@ +## +# Copyright (C) 2024 Hedera Hashgraph, LLC +# +# 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. +## + +name: "Release Legacy Images" +on: + workflow_dispatch: + inputs: + runner-version: + description: "Runner Version:" + type: string + required: true + + ## Upstream Github Action Runner Container Hooks Version + runner-container-hooks-version: + description: "Container Hooks Version:" + type: string + required: false + default: "0.6.1" + + ## Upstream Docker Version + docker-version: + description: "Docker Version:" + type: string + required: false + default: "24.0.9" + + ## Linux Architectures for Multi-Arch Builds + platforms: + description: "Platforms:" + type: string + required: false + default: "linux/amd64,linux/arm64" + + build-default-image: + description: "Build Default Image" + type: boolean + required: false + default: true + + build-dind-image: + description: "Build DinD Image" + type: boolean + required: false + default: true + + build-dind-rootless-image: + description: "Build DinD Rootless Image" + type: boolean + required: false + default: false + + dry-run-enabled: + description: "Perform Dry Run" + type: boolean + required: false + default: true + +defaults: + run: + shell: bash +Intentionally broken +jobs: + versions: + name: Upstream Versions + uses: ./.github/workflows/zxc-retrieve-upstream-versions.yaml + with: + explicit-runner-version: ${{ github.event.inputs.runner-version }} + explicit-hooks-version: ${{ github.event.inputs.runner-container-hooks-version }} + + legacy-images: + name: Legacy Images + uses: ./.github/workflows/zxc-build-legacy-images.yaml + needs: + - versions + strategy: + matrix: + base-os-image: + - ubuntu-22.04 + - ubuntu-20.04 + with: + custom-job-label: "Release (${{ matrix.base-os-image }})" + base-os-image: ${{ matrix.base-os-image }} + runner-version: ${{ needs.versions.outputs.runner }} + runner-container-hooks-version: ${{ needs.versions.outputs.hooks }} + docker-version: ${{ github.event.inputs.docker-version || '24.0.9' }} + platforms: ${{ github.event.inputs.platforms || 'linux/amd64,linux/arm64' }} + build-default-image: ${{ github.event.inputs.build-default-image == 'true' }} + build-dind-image: ${{ github.event.inputs.build-dind-image == 'true' }} + build-dind-rootless-image: ${{ github.event.inputs.build-dind-rootless-image == 'true' }} + dry-run-enabled: ${{ github.event.inputs.dry-run-enabled == 'true' }} diff --git a/.github/workflows/zxc-retrieve-upstream-versions.yaml b/.github/workflows/zxc-retrieve-upstream-versions.yaml index d841439..c4c052c 100644 --- a/.github/workflows/zxc-retrieve-upstream-versions.yaml +++ b/.github/workflows/zxc-retrieve-upstream-versions.yaml @@ -22,6 +22,16 @@ name: "ZXC: Retrieve Upstream Versions" on: workflow_call: inputs: + explicit-runner-version: + description: "Runner Version:" + type: string + required: false + default: "" + explicit-hooks-version: + description: "Container Hooks Version:" + type: string + required: false + default: "" custom-job-label: description: "Custom Job Label" type: string @@ -89,16 +99,32 @@ jobs: semver --version echo "::endgroup::" + - name: Validate Explicit Runner Version + id: explicit-runner + if: ${{ inputs.explicit-runner-version != '' }} + run: | + VERSION="$(semver get release "${{ inputs.explicit-runner-version }}")" + echo "version=${VERSION}" >>"${GITHUB_OUTPUT}" + - name: Retrieve Runner Version id: runner run: | - LATEST_TAG="$(gh release view -R actions/runner --json tagName | jq -r '.tagName')" + TARGET_TAG="${{ steps.explicit-runner.outputs.version || '' }}" + LATEST_TAG="$(gh release view ${TARGET_TAG} -R actions/runner --json tagName | jq -r '.tagName')" VERSION="$(semver get release ${LATEST_TAG})" echo "version=${VERSION}" >>"${GITHUB_OUTPUT}" + - name: Validate Explicit Hooks Version + id: explicit-hooks + if: ${{ inputs.explicit-hooks-version != '' }} + run: | + VERSION="$(semver get release "${{ inputs.explicit-hooks-version }}")" + echo "version=${VERSION}" >>"${GITHUB_OUTPUT}" + - name: Retrieve Runner Container Hooks Version id: hooks run: | - LATEST_TAG="$(gh release view -R actions/runner-container-hooks --json tagName | jq -r '.tagName')" + TARGET_TAG="${{ steps.explicit-hooks.outputs.version || '' }}" + LATEST_TAG="$(gh release view ${TARGET_TAG} -R actions/runner-container-hooks --json tagName | jq -r '.tagName')" VERSION="$(semver get release ${LATEST_TAG})" echo "version=${VERSION}" >>"${GITHUB_OUTPUT}"