Skip to content

Commit

Permalink
ci: add manual release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Klick <[email protected]>
  • Loading branch information
nathanklick committed Jul 31, 2024
1 parent dc620ee commit 795979e
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 2 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/flow-release-legacy-images.yaml
Original file line number Diff line number Diff line change
@@ -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' }}
30 changes: 28 additions & 2 deletions .github/workflows/zxc-retrieve-upstream-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"

0 comments on commit 795979e

Please sign in to comment.