-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (76 loc) · 2.98 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
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.12'
tag:
description: 'Tag to attach to image'
required: false
default: '3.12.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.12'
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.12'
branch=$(test -n "${{github.event.inputs.branch}}" && echo "${{github.event.inputs.branch}}" || echo $branchDefault)
echo BRANCH=$branch >> $GITHUB_OUTPUT
tagDefault='3.12.0-nightly'
tag=$(test -n "${{github.event.inputs.tag}}" && echo "${{github.event.inputs.tag}}" || echo $tagDefault)
echo TAG=$tag >> $GITHUB_OUTPUT
channelDefault='candidate-3.12'
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 }}"
}