Generate Images Digests #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Images Digests | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
type: string | |
description: "e.g: v2.8.4" | |
required: true | |
base_registry: | |
type: choice | |
description: "registry where the images were first uploaded to" | |
options: | |
- "registry.rancher.com" | |
- "docker.io" | |
- "stgregistry.suse.com" | |
required: true | |
rancher_repo_owner: | |
type: string | |
description: "org that the rancher repo is located in" | |
default: "rancher" | |
required: false | |
prime_only: | |
type: boolean | |
description: "release is prime only" | |
default: true | |
required: true | |
jobs: | |
digests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup ecm-distro-tools | |
uses: tashima42/ecm-distro-tools@linux-digests | |
with: | |
version: v0.0.7 | |
- name: Create ecm config file | |
run: | | |
mkdir -p ~/.ecm-distro-tools | |
release config gen | |
- name: Generate Digests | |
run: | | |
export LINUX_IMAGES_URL=https://github.com/${{ github.event.inputs.rancher_repo_owner }}/rancher/releases/download/${{ github.event.inputs.tag }}/rancher-images.txt | |
export WINDOWS_IMAGES_URL=https://github.com/${{ github.event.inputs.rancher_repo_owner }}/rancher/releases/download/${{ github.event.inputs.tag }}/rancher-windows-images.txt | |
if [[ ${{ github.event.inputs.prime_only }} = true ]]; then | |
export LINUX_IMAGES_URL=https://prime.ribs.rancher.io/rancher/${{ github.event.inputs.tag }}/rancher-images.txt | |
export WINDOWS_IMAGES_URL=https://prime.ribs.rancher.io/rancher/${{ github.event.inputs.tag }}/rancher-windows-images.txt | |
fi | |
mkdir -p /tmp/dist | |
release generate rancher docker-images-digests \ | |
--images-url "$LINUX_IMAGES_URL" \ | |
--output-file /tmp/dist/rancher-images-digests-linux-amd64.txt \ | |
--registry "${{ github.event.inputs.base_registry }}" | |
release generate rancher docker-images-digests \ | |
--images-url "$WINDOWS_IMAGES_URL" \ | |
--output-file /tmp/dist/rancher-images-digests-windows-amd64.txt \ | |
--registry "${{ github.event.inputs.base_registry }}" | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "digests-${{ github.event.inputs.tag }}" | |
path: /tmp/dist | |
if-no-files-found: error | |
retention-days: 1 | |
overwrite: false |