-
Notifications
You must be signed in to change notification settings - Fork 51
145 lines (141 loc) · 5.4 KB
/
release_prep.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Workflow Secrets required to be setup in repo:
# QUAY_ID
# QUAY_TOKEN
# DSP_DEVS_ACCESS_TOKEN
name: "Release Prep"
run-name: Prep Release
on:
workflow_dispatch:
inputs:
previous_release_tag:
default: 'v1.x.y'
description: 'Previous Release tag'
required: true
target_release:
default: '1.x'
description: 'Target Minor Release (e.g. 1.2, 1.3, etc.)'
required: true
gh_org:
default: 'opendatahub-io'
description: 'DSPO GitHub Org'
required: true
quay_org:
type: string
default: 'opendatahub'
description: 'Quay Organization to push builds.'
required: true
overwrite_imgs:
default: 'true'
description: 'Overwrite images in quay if they already exist for this release.'
required: true
env:
GH_USER_EMAIL: 140449482+dsp-developers@users.noreply.github.com
GH_USER_NAME: dsp-developers
TARGET_RELEASE: ${{ inputs.target_release }}
MINOR_RELEASE_WILDCARD: ${{ inputs.target_release }}.x
MINOR_RELEASE_BRANCH: v${{ inputs.target_release }}.x
MINOR_RELEASE_TAG: v${{ inputs.target_release }}.0
QUAY_ORG: ${{ inputs.quay_org }}
GH_ORG: ${{ inputs.gh_org }}
DSPO_REPOSITORY: data-science-pipelines-operator
DSPO_REPOSITORY_FULL: ${{ inputs.gh_org }}/data-science-pipelines-operator
DSP_REPOSITORY: data-science-pipelines
DSP_REPOSITORY_FULL: ${{ inputs.gh_org }}/data-science-pipelines
PREVIOUS_RELEASE_TAG: ${{ inputs.previous_release_tag }}
OVERWRITE_IMAGES: ${{ inputs.overwrite_imgs }}
CONFIG_TEMPLATE: "./.github/scripts/release_prep/templates/config.yaml"
jobs:
prereqs:
name: Prerequisites
runs-on: ubuntu-latest
outputs:
prereqs_successful: ${{ steps.vars.outputs.prereqs_successful }}
steps:
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.DSP_DEVS_ACCESS_TOKEN }}
- name: compatibility doc
id: vars
env:
GH_TOKEN: ${{ secrets.DSP_DEVS_ACCESS_TOKEN }}
GH_USER_NAME: ${{ env.GH_USER_NAME }}
GH_USER_EMAIL: ${{ env.GH_USER_EMAIL }}
TARGET_RELEASE: ${{ env.TARGET_RELEASE }}
MINOR_RELEASE_WILDCARD: ${{ env.MINOR_RELEASE_WILDCARD }}
MINOR_RELEASE_BRANCH: ${{ env.MINOR_RELEASE_BRANCH }}
DSPO_REPOSITORY_FULL: ${{ env.DSPO_REPOSITORY_FULL }}
DSPO_REPOSITORY: ${{ env.DSPO_REPOSITORY }}
run: ./.github/scripts/release_prep/prereqs.sh
create_branches:
name: Create Release Branches
runs-on: ubuntu-latest
needs: prereqs
if: needs.prereqs.outputs.prereqs_successful == 'true'
steps:
- uses: actions/checkout@v3
name: checkout
with:
token: ${{ secrets.DSP_DEVS_ACCESS_TOKEN }}
fetch-depth: 0
- name: create branches
env:
GH_TOKEN: ${{ secrets.DSP_DEVS_ACCESS_TOKEN }}
GH_USER_NAME: ${{ env.GH_USER_NAME }}
MINOR_RELEASE_BRANCH: ${{ env.MINOR_RELEASE_BRANCH }}
DSPO_REPOSITORY_FULL: ${{ env.DSPO_REPOSITORY_FULL }}
DSP_REPOSITORY_FULL: ${{ env.DSP_REPOSITORY_FULL }}
WORKING_DIR: ${{ github.workspace }}
run: ./.github/scripts/release_prep/create_branches.sh
# NOTE: env from current workflow does not extend to re-usable workflows
# so "with:" commands do not get "env.*" context, but "needs.*.outputs.*" works
# this is a workaround.
# More Context: https://github.com/orgs/community/discussions/26671
get-env-vars:
name: Get Re-Usable Env Vars
runs-on: ubuntu-latest
outputs:
MINOR_RELEASE_BRANCH: ${{ env.MINOR_RELEASE_BRANCH }}
MINOR_RELEASE_TAG: ${{ env.MINOR_RELEASE_TAG }}
QUAY_ORG: ${{ env.QUAY_ORG }}
DSPO_GH_ORG: ${{ env.DSP_REPOSITORY_FULL }}
OVERWRITE_IMAGES: ${{ env.OVERWRITE_IMAGES }}
steps:
- run: echo "Storing env vars for re-usable workflow."
build_images:
name: Build/Push Images
needs: [create_branches, get-env-vars]
if: needs.prereqs.outputs.prereqs_successful == 'true'
uses: ./.github/workflows/build-tags.yml
with:
src_branch: ${{ needs.get-env-vars.outputs.MINOR_RELEASE_BRANCH }}
target_tag: ${{ needs.get-env-vars.outputs.MINOR_RELEASE_TAG }}
quay_org: ${{ needs.get-env-vars.outputs.QUAY_ORG }}
dsp_org_repo: ${{ needs.get-env-vars.outputs.DSPO_GH_ORG }}
overwrite_imgs: ${{ needs.get-env-vars.outputs.OVERWRITE_IMAGES }}
secrets: inherit
generate_pr:
name: Generate Release PR
runs-on: ubuntu-latest
needs: build_images
steps:
- uses: actions/checkout@v3
name: checkout
with:
token: ${{ secrets.DSP_DEVS_ACCESS_TOKEN }}
ref: ${{ env.MINOR_RELEASE_BRANCH }}
- name: generate pr
env:
GH_TOKEN: ${{ secrets.DSP_DEVS_ACCESS_TOKEN }}
GH_USER_NAME: ${{ env.GH_USER_NAME }}
GH_USER_EMAIL: ${{ env.GH_USER_EMAIL }}
TARGET_RELEASE: ${{ env.TARGET_RELEASE }}
MINOR_RELEASE_BRANCH: ${{ env.MINOR_RELEASE_BRANCH }}
DSPO_REPOSITORY: ${{ env.DSPO_REPOSITORY }}
DSPO_REPOSITORY_FULL: ${{ env.DSPO_REPOSITORY_FULL }}
GH_ORG: ${{ env.GH_ORG }}
QUAY_ORG: ${{ env.QUAY_ORG }}
MINOR_RELEASE_TAG: ${{ env.MINOR_RELEASE_TAG }}
PREVIOUS_RELEASE_TAG: ${{ env.PREVIOUS_RELEASE_TAG }}
CONFIG_TEMPLATE: ${{ env.CONFIG_TEMPLATE }}
run: ./.github/scripts/release_prep/generate_pr.sh