forked from alibaba/GraphScope
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (100 loc) · 4.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
name: Cut Release
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:
release-gss-image:
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/[email protected]
- 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}
sudo make graphscope-store-image
- name: Release Nightly Image
if: ${{ github.ref == 'refs/heads/main' && 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
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:nightly
sudo docker push ${{ env.GSS_IMAGE }}:nightly
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/v}
- 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
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 }}
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/[email protected]
# 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
cd ${GITHUB_WORKSPACE}/charts
ossutil64 -i "${oss_accesskey_id}" \
-k "${oss_accesskey_secret}" \
-e ${{ env.OSS_ENDPOINT }} \
cp -r oss://graphscope/charts ./
- 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
# generate index.yaml
helm repo index . --url ${{ env.HELM_CHARTS_URL }}
- name: Extract Tag Name
id: tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/v}
- 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/index.yaml:/charts/index.yaml