forked from alibaba/GraphScope
-
Notifications
You must be signed in to change notification settings - Fork 1
242 lines (210 loc) · 9.51 KB
/
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: Cut Release
# on: [push, pull_request]
on:
workflow_dispatch:
schedule:
# The notifications for scheduled workflows are sent to the user who
# last modified the cron syntax in the workflow file.
# Trigger the workflow at 03:00(CST) every day.
- cron: '00 19 * * *'
push:
tags:
- 'v*'
env:
DOCKER_URL: registry.cn-hongkong.aliyuncs.com
GSS_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-store
HELM_CHARTS_URL: https://graphscope.oss-cn-beijing.aliyuncs.com/charts/
OSS_REGION: oss-cn-beijing
OSS_ENDPOINT: oss-cn-beijing.aliyuncs.com
jobs:
build-gss-image-x86-64:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build GraphScope Store Image
run: |
cd ${GITHUB_WORKSPACE}/k8s
sudo make graphscope-store VERSION=${SHORT_SHA}
- name: Release Nightly Image
# if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope' }}
# GraphScope-Store doesn't need nightly release yet.
# To save some resources, comment this step out temporarily.
if: false
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
# docker tag: 0.15.0 -> 0.15.0a20220808
# x86_64
# arch=$(uname -m)
time=$(date "+%Y%m%d")
version=$(cat ${GITHUB_WORKSPACE}/VERSION)
tag="${version}a${time}"
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${tag}
sudo docker push ${{ env.GSS_IMAGE }}:${tag}
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Release Image
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
# x86_64
# arch=$(uname -m)
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}
sudo docker push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}
build-gss-image-aarch64:
# if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
if: false
runs-on: [self-hosted, Linux, ARM64]
steps:
- uses: actions/checkout@v3
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build GraphScope Store Image
run: |
cd ${GITHUB_WORKSPACE}/k8s
sudo make graphscope-store VERSION=${SHORT_SHA}
- name: Release Nightly Image
# if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope' }}
# GraphScope-Store doesn't need nightly release yet.
# To save some resources, comment this step out temporarily.
if: false
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
# docker tag: 0.15.0 -> 0.15.0a20220808
# aarch64
arch=$(uname -m)
time=$(date "+%Y%m%d")
version=$(cat ${GITHUB_WORKSPACE}/VERSION)
tag="${version}a${time}"-${arch}
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${tag}
sudo docker push ${{ env.GSS_IMAGE }}:${tag}
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Release Image
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
# aarch64
arch=$(uname -m)
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-${arch}
sudo docker push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-${arch}
- name: Clean Nightly Image
if: false
run: |
# docker tag: 0.15.0 -> 0.15.0a20220808
# aarch64
arch=$(uname -m)
time=$(date "+%Y%m%d")
version=$(cat ${GITHUB_WORKSPACE}/VERSION)
tag="${version}a${time}"-${arch}
# clean
sudo docker rmi -f graphscope-store:${SHORT_SHA} || true
sudo docker rmi -f ${{ env.GSS_IMAGE }}:${tag} || true
- name: Clean Release Image
if: always()
run: |
# aarch64
arch=$(uname -m)
sudo docker rmi -f graphscope-store:${SHORT_SHA} || true
sudo docker rmi -f ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-${arch} || true
push-gss-image-manifest:
# if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
if: false
runs-on: ubuntu-20.04
needs: [build-gss-image-x86-64, build-gss-image-aarch64]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create and Push Docker Manifest
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
# create
sudo docker manifest create \
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }} \
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-x86_64 \
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-aarch64
# push
sudo docker manifest push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}
release-helm-charts:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
# this step is needed for update index.yaml
- name: Download Released Charts
env:
oss_accesskey_id: ${{ secrets.ALIYUN_OSS_ACCESSKEY_ID }}
oss_accesskey_secret: ${{ secrets.ALIYUN_OSS_ACCESSKEY_SECRET }}
run: |
# download ossutils
sudo wget -O /usr/bin/ossutil64 http://gosspublic.alicdn.com/ossutil/1.7.7/ossutil64
sudo chmod +x /usr/bin/ossutil64
# download released charts
ossutil64 -i "${oss_accesskey_id}" \
-k "${oss_accesskey_secret}" \
-e ${{ env.OSS_ENDPOINT }} \
cp -r oss://graphscope/charts ./charts
# ossutil64 will downloads contents to folder ./charts/charts
pushd charts/
mv charts/*.tgz charts/*.yaml ./
popd
- name: Package Charts
run: |
# download helm
if ! command -v helm &> /dev/null; then
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
fi
cd ${GITHUB_WORKSPACE}/charts
# package graphscope
helm package ./graphscope
# package graphscope-store
helm package --dependency-update ./graphscope-store
# package gie-standalone
helm package --dependency-update ./gie-standalone
# generate index.yaml
helm repo index . --url ${{ env.HELM_CHARTS_URL }}
- name: Extract Tag Name
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Upload Charts to OSS
uses: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.ALIYUN_OSS_ACCESSKEY_ID }}
key-secret: ${{ secrets.ALIYUN_OSS_ACCESSKEY_SECRET }}
region: ${{ env.OSS_REGION }}
bucket: graphscope
assets: |
charts/graphscope-${{ steps.tag.outputs.TAG }}.tgz:/charts/graphscope-${{ steps.tag.outputs.TAG }}.tgz
charts/graphscope-store-${{ steps.tag.outputs.TAG }}.tgz:/charts/graphscope-store-${{ steps.tag.outputs.TAG }}.tgz
charts/gie-standalone-${{ steps.tag.outputs.TAG }}.tgz:/charts/gie-standalone-${{ steps.tag.outputs.TAG }}.tgz
charts/index.yaml:/charts/index.yaml