Skip to content

Nightly

Nightly #261

Workflow file for this run

---
name: Nightly
on:
workflow_dispatch:
inputs:
# Defaults are here for manual run examples, if changed, must be updated in params step too
branch:
description: 'Branch to target for release'
required: false
default: 'redhat-3.10'
tag:
description: 'Tag to attach to image'
required: false
default: '3.10.0-nightly'
channel:
description: 'Operatorhub channel, see https://github.com/redhat-openshift-ecosystem/community-operators-prod/blob/main/operators/project-quay/project-quay.package.yaml'
required: false
default: 'candidate-3.10'
clair-version:
description: 'Clair version, will use latest if left empty'
required: false
schedule:
- cron: '30 5 * * *'
jobs:
input:
name: Prepare Inputs
runs-on: 'ubuntu-latest'
outputs:
date: ${{ steps.params.outputs.DATE }}
branch: ${{ steps.params.outputs.BRANCH }}
tag: ${{ steps.params.outputs.TAG }}
channel: ${{ steps.params.outputs.CHANNEL }}
clair-version: ${{ steps.clair.outputs.VERSION }}
steps:
- name: Get Inputs
id: params
# Default vars must be updated if nightly version is changed
run: |
branchDefault='redhat-3.10'
branch=$(test -n "${{github.event.inputs.branch}}" && echo "${{github.event.inputs.branch}}" || echo $branchDefault)
echo BRANCH=$branch >> $GITHUB_OUTPUT
tagDefault='3.10.0-nightly'
tag=$(test -n "${{github.event.inputs.tag}}" && echo "${{github.event.inputs.tag}}" || echo $tagDefault)
echo TAG=$tag >> $GITHUB_OUTPUT
channelDefault='candidate-3.10'
channel=$(test -n "${{github.event.inputs.channel}}" && echo "${{github.event.inputs.channel}}" || echo $channelDefault)
echo CHANNEL=$channel >> $GITHUB_OUTPUT
today=$(date -u '+%Y%m%d')
echo DATE=$today >> $GITHUB_OUTPUT
- name: Set Clair Version
id: clair
run: |
online=$(curl -sL https://api.github.com/repos/quay/clair/releases/latest | jq -r ".tag_name")
semver=$(test -n "${{github.event.inputs.clair-version}}" && echo "${{github.event.inputs.clair-version}}" || echo $online)
version=$(echo $semver | sed 's/v//')
echo VERSION=$version >> $GITHUB_OUTPUT
release:
name: Trigger Release Workflow
runs-on: 'ubuntu-latest'
needs: input
steps:
- uses: convictional/[email protected]
with:
owner: 'quay'
repo: 'releases'
github_token: ${{ secrets.PAT }}
workflow_file_name: main.yml
ref: 'main'
wait_interval: 30
client_payload: |
{
"branch": "${{ needs.input.outputs.branch }}",
"tag": "${{ needs.input.outputs.tag }}.${{ needs.input.outputs.date }}",
"channel": "${{ needs.input.outputs.channel }}",
"clair-version": "${{ needs.input.outputs.clair-version }}"
}