Skip to content

Commit 2886d0c

Browse files
f
Signed-off-by: LiZhenCheng9527 <[email protected]>
1 parent c9e3098 commit 2886d0c

File tree

2 files changed

+53
-50
lines changed

2 files changed

+53
-50
lines changed

.github/workflows/release-master.yaml

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -18,63 +18,65 @@ jobs:
1818
- linux/amd64
1919
- linux/arm64
2020
steps:
21-
- name: Prepare
22-
run: |
23-
platform=${{ matrix.platform }}
24-
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
25-
26-
- name: change kmesh version
27-
if: github.ref_name != 'main'
28-
env:
29-
VERSION: ${{ github.ref_name }}
30-
run: make update-version UPDATE_VERSION=${{ github.ref_name }}
21+
- uses: actions/checkout@v4
22+
23+
- name: Prepare
24+
run: |
25+
platform=${{ matrix.platform }}
26+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
27+
28+
- name: change kmesh version
29+
if: github.ref_name != 'main'
30+
env:
31+
VERSION: ${{ github.ref_name }}
32+
run: make update-version UPDATE_VERSION=${{ github.ref_name }}
3133

32-
- name: Docker meta
33-
id: meta
34-
uses: docker/metadata-action@v5
35-
with:
36-
images: ${{ env.REGISTRY_IMAGE }}
37-
# generate Docker tags based on the following events/attributes
38-
tags: |
39-
type=ref,event=tag
40-
type=semver,pattern={{version}}
41-
type=raw,value=latest,enable={{is_default_branch}}
42-
- name: Set up QEMU
43-
uses: docker/setup-qemu-action@v3
34+
- name: Docker meta
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY_IMAGE }}
39+
# generate Docker tags based on the following events/attributes
40+
tags: |
41+
type=ref,event=tag
42+
type=semver,pattern={{version}}
43+
type=raw,value=latest,enable={{is_default_branch}}
44+
- name: Set up QEMU
45+
uses: docker/setup-qemu-action@v3
4446

45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v3
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
4749

48-
- name: Login to Github Container Registry
49-
run: echo "${{ secrets.GH_PAT }}" | docker login ghcr.io -u $ --password-stdin
50+
- name: Login to Github Container Registry
51+
run: echo "${{ secrets.GH_PAT }}" | docker login ghcr.io -u $ --password-stdin
5052

51-
- name: Checkout code
52-
uses: actions/checkout@v3
53+
- name: Checkout code
54+
uses: actions/checkout@v3
5355

54-
- name: Build and Push by digest
55-
id: build
56-
uses: docker/build-push-action@v6
57-
with:
58-
context: .
59-
platforms: ${{ matrix.platform }}
60-
labels: ${{ steps.meta.outputs.labels }}
61-
file: build/docker/github.dockerfile
62-
tags: ${{ steps.meta.outputs.tags }}
63-
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},name-canonical=true,push=true
56+
- name: Build and Push by digest
57+
id: build
58+
uses: docker/build-push-action@v6
59+
with:
60+
context: .
61+
platforms: ${{ matrix.platform }}
62+
labels: ${{ steps.meta.outputs.labels }}
63+
file: build/docker/github.dockerfile
64+
tags: ${{ steps.meta.outputs.tags }}
65+
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},name-canonical=true,push=true
6466

65-
- name: Export digest
66-
run: |
67-
mkdir -p /tmp/digests
68-
digest="${{ steps.build.outputs.digest }}"
69-
touch "/tmp/digests/${digest#sha256:}"
67+
- name: Export digest
68+
run: |
69+
mkdir -p /tmp/digests
70+
digest="${{ steps.build.outputs.digest }}"
71+
touch "/tmp/digests/${digest#sha256:}"
7072
71-
- name: Upload digest
72-
uses: actions/upload-artifact@v4
73-
with:
74-
name: digests-${{ env.PLATFORM_PAIR }}
75-
path: /tmp/digests/*
76-
if-no-files-found: error
77-
retention-days: 1
73+
- name: Upload digest
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: digests-${{ env.PLATFORM_PAIR }}
77+
path: /tmp/digests/*
78+
if-no-files-found: error
79+
retention-days: 1
7880

7981
merge:
8082
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
GOOS: ${{ matrix.os }}
4343
GOARCH: ${{ matrix.arch }}
4444
run: make kmeshctl OUT=kmeshctl-${{ matrix.os }}-${{ matrix.arch }}
45+
4546
- name: Uploading kmeshctl assets
4647
uses: softprops/action-gh-release@v2
4748
with:

0 commit comments

Comments
 (0)