forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (170 loc) · 5.66 KB
/
create_release.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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Create a flyte release
on:
workflow_dispatch:
inputs:
version:
description: "version name. example v0.1.1"
required: true
jobs:
generate-tags:
name: Generate git tags
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.FLYTE_BOT_PAT }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${{ github.event.inputs.version }}`,
sha: context.sha
})
const components = [
"datacatalog",
"flyteadmin",
"flytecopilot",
"flyteidl",
"flyteplugins",
"flytepropeller",
"flytestdlib",
];
for (const c of components) {
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${c}/${{ github.event.inputs.version }}`,
sha: context.sha
})
}
build-docker-images:
needs:
- generate-tags
uses: ./.github/workflows/publish-images.yml
with:
version: ${{ github.event.inputs.version }}
push: true
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }}
publish-flyte-binary-image:
name: Publish flyte binary image for the release version
runs-on: ubuntu-latest
needs:
- generate-tags
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
- name: Tag image to release version
run: |
for release in latest ${{ github.event.inputs.version }}; do
docker buildx imagetools create --tag "ghcr.io/${{ github.repository_owner }}/flyte-binary-release:${release}" "ghcr.io/${{ github.repository_owner }}/flyte-binary:sha-${{ github.sha }}"
done
publish-flyte-component-image:
name: Publish flyte component image for the release version
runs-on: ubuntu-latest
needs:
- build-docker-images
strategy:
matrix:
component:
[
datacatalog,
flyteadmin,
flyteconsole,
flytecopilot,
flytepropeller,
flytescheduler,
]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: yq - portable yaml processor
uses: mikefarah/[email protected]
- name: Get Latest Version of component
id: set_version
run: |
if [ ${{ matrix.component }} = "flytecopilot" ]; then
echo ::set-output name=version::$(yq eval '.configmap.copilot.plugins.k8s.co-pilot.image' charts/flyte-core/values.yaml | cut -d ":" -f 2 )
else
echo ::set-output name=version::$(yq eval '.${{ matrix.component }}.image.tag' charts/flyte-core/values.yaml)
fi
shell: bash
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
- name: Tag Image to release version
run: |
for release in latest ${{ github.event.inputs.version }}; do
docker buildx imagetools create --tag "ghcr.io/${{ github.repository_owner }}/${{ matrix.component }}-release:${release}" "ghcr.io/${{ github.repository_owner }}/${{ matrix.component }}:${{ steps.set_version.outputs.version }}"
done
helm-release:
name: Flyte helm release
runs-on: ubuntu-latest
needs:
- build-docker-images
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 'latest' # default is latest (stable)
token: ${{ secrets.GITHUB_TOKEN }} # only needed if version is 'latest'
id: install
- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
- name: Prepare Flyte Helm Release
env:
VERSION: ${{ github.event.inputs.version }}
REPOSITORY: "https://flyteorg.github.io/flyte"
run: |
make prepare_artifacts
- name: Run chart-releaser
uses: stefanprodan/[email protected]
with:
token: "${{ secrets.FLYTE_BOT_PAT }}"
linting: off
manifest-release:
name: Flyte manifest release
runs-on: ubuntu-latest
needs:
- build-docker-images
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Prepare Flyte Release
env:
VERSION: ${{ github.event.inputs.version }}
run: |
make prepare_artifacts
git stash
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist --release-notes=CHANGELOG/CHANGELOG-${{ github.event.inputs.version }}.md
env:
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}