1+ name : JuiceFS CSI Release
2+ on :
3+ push :
4+ branches :
5+ - master
6+ - release-*
7+
8+ jobs :
9+ release :
10+ runs-on : ubuntu-latest
11+ outputs :
12+ version : ${{ steps.version.outputs.version }}
13+ steps :
14+ - name : " Checkout Code"
15+ uses : actions/checkout@v4
16+ with :
17+ fetch-depth : 0
18+
19+ - name : Determine version
20+ id : version
21+ run : |
22+ # Get the latest tag that matches v* pattern
23+ LATEST_TAG=$(git describe --tags --match 'v*' --abbrev=0 2>/dev/null || echo "v0.0.0")
24+
25+ # Extract major, minor, patch
26+ VERSION=${LATEST_TAG#v}
27+ MAJOR=$(echo $VERSION | cut -d. -f1)
28+ MINOR=$(echo $VERSION | cut -d. -f2)
29+ PATCH=$(echo $VERSION | cut -d. -f3)
30+
31+ # Increment patch version
32+ PATCH=$((PATCH + 1))
33+ NEXT_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
34+
35+ echo "version=${NEXT_VERSION}" >> $GITHUB_OUTPUT
36+ echo "Next version: ${NEXT_VERSION}"
37+
38+ - name : Create tag
39+ run : |
40+ git config --local user.email "[email protected] " 41+ git config --local user.name "GitHub Action"
42+ git tag -a ${{ steps.version.outputs.version }} -m "Release ${{ steps.version.outputs.version }}"
43+ git push origin ${{ steps.version.outputs.version }}
44+
45+ build-csi :
46+ needs : release
47+ runs-on : ubuntu-latest
48+ strategy :
49+ matrix :
50+ region :
51+ - name : us-east-1
52+ identifier : virginia
53+ - name : eu-west-2
54+ identifier : london
55+ steps :
56+ - name : " Checkout"
57+ uses : actions/checkout@v4
58+
59+ - name : Configure AWS credentials
60+ uses : aws-actions/configure-aws-credentials@v4
61+ with :
62+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
63+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
64+ aws-region : ${{ matrix.region.name }}
65+
66+ - name : Login to ECR
67+ id : login-ecr
68+ uses : aws-actions/amazon-ecr-login@v2
69+
70+ - uses : depot/setup-action@v1
71+
72+ - name : Build and Push CSI Driver
73+ uses : depot/build-push-action@v1
74+ with :
75+ platforms : linux/amd64,linux/arm64
76+ context : .
77+ file : docker/csi.Dockerfile
78+ build-contexts : |
79+ project=.
80+ ui=./dashboard-ui-v2
81+ build-args : |
82+ TARGETARCH=amd64
83+ JFSCHAN=stable
84+ JUICEFS_CE_MOUNT_IMAGE=juicedata/mount:ce-latest
85+ JUICEFS_EE_MOUNT_IMAGE=juicedata/mount:ee-5.2.8-1305e8c
86+ provenance : false
87+ token : ${{ secrets.DEPOT_TOKEN }}
88+ push : true
89+ tags : |
90+ ${{ steps.login-ecr.outputs.registry }}/juicefs-csi-driver-${{ matrix.region.identifier }}:${{ needs.release.outputs.version }}
91+ ${{ steps.login-ecr.outputs.registry }}/juicefs-csi-driver-${{ matrix.region.identifier }}:latest
92+
93+ build-mount-images :
94+ needs : release
95+ runs-on : ubuntu-latest
96+ strategy :
97+ matrix :
98+ region :
99+ - name : us-east-1
100+ identifier : virginia
101+ - name : eu-west-2
102+ identifier : london
103+ edition :
104+ - name : ce
105+ dockerfile : ce.juicefs.Dockerfile
106+ build-args : |
107+ CEJUICEFS_VERSION=latest
108+ - name : ee
109+ dockerfile : ee.juicefs.Dockerfile
110+ build-args : |
111+ EEJUICEFS_VERSION=5.2.8-1305e8c
112+ steps :
113+ - name : " Checkout"
114+ uses : actions/checkout@v4
115+
116+ - name : Configure AWS credentials
117+ uses : aws-actions/configure-aws-credentials@v4
118+ with :
119+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
120+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
121+ aws-region : ${{ matrix.region.name }}
122+
123+ - name : Login to ECR
124+ id : login-ecr
125+ uses : aws-actions/amazon-ecr-login@v2
126+
127+ - uses : depot/setup-action@v1
128+
129+ - name : Build and Push Mount Image (${{ matrix.edition.name }})
130+ uses : depot/build-push-action@v1
131+ with :
132+ platforms : linux/amd64,linux/arm64
133+ context : docker
134+ file : docker/${{ matrix.edition.dockerfile }}
135+ build-args : ${{ matrix.edition.build-args }}
136+ provenance : false
137+ token : ${{ secrets.DEPOT_TOKEN }}
138+ push : true
139+ tags : |
140+ ${{ steps.login-ecr.outputs.registry }}/juicefs-mount-${{ matrix.edition.name }}-${{ matrix.region.identifier }}:${{ needs.release.outputs.version }}
141+ ${{ steps.login-ecr.outputs.registry }}/juicefs-mount-${{ matrix.edition.name }}-${{ matrix.region.identifier }}:latest
142+
143+ build-dashboard :
144+ needs : release
145+ runs-on : ubuntu-latest
146+ strategy :
147+ matrix :
148+ region :
149+ - name : us-east-1
150+ identifier : virginia
151+ - name : eu-west-2
152+ identifier : london
153+ steps :
154+ - name : " Checkout"
155+ uses : actions/checkout@v4
156+
157+ - uses : pnpm/action-setup@v4
158+ name : Install pnpm
159+ with :
160+ version : 9
161+ run_install : |
162+ cwd: dashboard-ui-v2
163+
164+ - name : Build dashboard
165+ run : make dashboard-dist
166+
167+ - name : Configure AWS credentials
168+ uses : aws-actions/configure-aws-credentials@v4
169+ with :
170+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
171+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
172+ aws-region : ${{ matrix.region.name }}
173+
174+ - name : Login to ECR
175+ id : login-ecr
176+ uses : aws-actions/amazon-ecr-login@v2
177+
178+ - uses : depot/setup-action@v1
179+
180+ - name : Build and Push Dashboard
181+ uses : depot/build-push-action@v1
182+ with :
183+ platforms : linux/amd64,linux/arm64
184+ context : .
185+ file : docker/dashboard.Dockerfile
186+ build-contexts : |
187+ project=.
188+ ui=./dashboard-ui-v2
189+ provenance : false
190+ token : ${{ secrets.DEPOT_TOKEN }}
191+ push : true
192+ tags : |
193+ ${{ steps.login-ecr.outputs.registry }}/juicefs-csi-dashboard-${{ matrix.region.identifier }}:${{ needs.release.outputs.version }}
194+ ${{ steps.login-ecr.outputs.registry }}/juicefs-csi-dashboard-${{ matrix.region.identifier }}:latest
195+
196+ notify :
197+ needs : [release, build-csi, build-mount-images, build-dashboard]
198+ runs-on : ubuntu-latest
199+ if : always() && needs.build-csi.result == 'success' && needs.build-mount-images.result == 'success' && needs.build-dashboard.result == 'success'
200+ steps :
201+ - name : Notify Slack!
202+ uses : someimportantcompany/github-actions-slack-message@v1
203+ with :
204+ webhook-url : ${{ secrets.SLACK_WEBHOOK_URL }}
205+ text : " :rocket: JuiceFS CSI Driver ${{ needs.release.outputs.version }} images built and pushed to all ECR registries! :rocket:"
0 commit comments