-
Notifications
You must be signed in to change notification settings - Fork 1.2k
80 lines (75 loc) · 2.87 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
name: release
on:
release:
types:
- published
concurrency:
group: release
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
package:
name: package
runs-on: [self-hosted, linux]
container:
image: vesoft/nebula-dev:centos7
steps:
- uses: webiny/[email protected]
with:
run: sh -c "find . -mindepth 1 -delete"
- uses: actions/checkout@v4
- uses: ./.github/actions/tagname-action
id: tag
- uses: vesoft-inc/.github/actions/setup-minio@master
with:
minio_url: ${{ secrets.MINIO_ENDPOINT }}
access_key: ${{ secrets.MINIO_KEY }}
secret_key: ${{ secrets.MINIO_SECRET }}
- name: Copy rc to release on MinIO
run: |
files=$(mc ls minio/rc-build/nebula-graph/${{ steps.tag.outputs.tagnum }}/ | awk '{print $6}' | grep -v '/$')
for file in $files; do
mc cp minio/rc-build/nebula-graph/${{ steps.tag.outputs.tagnum }}/$file \
minio/release-build/nebula-graph/${{ steps.tag.outputs.tagnum }}/
done
mc cp -r minio/rc-build/nebula-graph/${{ steps.tag.outputs.tagnum }}/symbols/ \
minio/release-build/nebula-graph/${{ steps.tag.outputs.tagnum }}/symbols/
docker_build:
name: docker-build
runs-on: [self-hosted, linux]
strategy:
fail-fast: false
matrix:
service:
- graphd
- metad
- storaged
- tools
steps:
- uses: webiny/[email protected]
with:
run: sh -c "find . -mindepth 1 -delete"
- uses: actions/checkout@v4
- uses: ./.github/actions/tagname-action
id: tagname
- id: docker
run: |
majorver=$(git tag -l --sort=v:refname | tail -n1 | cut -f1 -d".")
tag=""
if [[ $majorver == ${{ steps.tagname.outputs.majorver }} ]]; then
tag="latest"
fi
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Sync docker images
env:
FROM_IMAGE: docker://${{ secrets.HARBOR_REGISTRY }}/rc/nebula-${{ matrix.service }}
TO_IMAGE: docker://docker.io/vesoft/nebula-${{ matrix.service }}
CMD: docker run --rm -i quay.io/containers/skopeo:latest copy -a --src-creds ${{ secrets.HARBOR_USERNAME }}:${{ secrets.HARBOR_PASSWORD }} --dest-creds ${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}
run: |
${{ env.CMD }} ${{ env.FROM_IMAGE }}:${{ steps.tagname.outputs.tag }} ${{ env.TO_IMAGE }}:${{ steps.tagname.outputs.tag }}
${{ env.CMD }} ${{ env.FROM_IMAGE }}:${{ steps.tagname.outputs.tag }} ${{ env.TO_IMAGE }}:${{ steps.tagname.outputs.majorver }}
if [[ ! -z "${{ steps.docker.outputs.tag }}" ]]; then
${{ env.CMD }} ${{ env.FROM_IMAGE }}:${{ steps.tagname.outputs.tag }} ${{ env.TO_IMAGE }}:${{ steps.docker.outputs.tag }}
fi