Skip to content

Commit 2e79f97

Browse files
committed
fix(*): fix release action
1 parent d2ccc9a commit 2e79f97

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,9 @@ jobs:
1414
packages: write
1515
steps:
1616
- name: Checkout code
17-
run: |
18-
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git .
19-
git checkout ${{ github.ref }}
20-
21-
- name: Set up Go
22-
run: |
23-
wget https://golang.org/dl/go1.24.7.linux-amd64.tar.gz
24-
sudo tar -C /usr/local -xzf go1.24.7.linux-amd64.tar.gz
25-
export PATH=$PATH:/usr/local/go/bin
26-
go version
27-
28-
- name: Build binary
29-
run: make all
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
3020

3121
- name: Login to GitHub Container Registry
3222
run: |
@@ -41,13 +31,19 @@ jobs:
4131
4232
- name: Build and push Docker image
4333
run: |
44-
docker build -t ghcr.io/${{ github.repository }}:${{ env.VERSION }} .
45-
docker tag ghcr.io/${{ github.repository }}:${{ env.VERSION }} ghcr.io/${{ github.repository }}:${{ env.MAJOR_MINOR }}
46-
docker push ghcr.io/${{ github.repository }}:${{ env.VERSION }}
47-
docker push ghcr.io/${{ github.repository }}:${{ env.MAJOR_MINOR }}
34+
docker build -t ghcr.io/${{ github.repository }}:v${{ env.VERSION }} .
35+
docker tag ghcr.io/${{ github.repository }}:v${{ env.VERSION }} ghcr.io/${{ github.repository }}:v${{ env.MAJOR_MINOR }}
36+
docker push ghcr.io/${{ github.repository }}:v${{ env.VERSION }}
37+
docker push ghcr.io/${{ github.repository }}:v${{ env.MAJOR_MINOR }}
4838
49-
- name: Create GitHub Release
39+
- name: Create or Update GitHub Release
5040
run: |
51-
gh release create ${{ github.ref_name }} ./build/external-dns-volcengine-webhook --generate-notes
41+
# Check if release already exists
42+
if gh release view ${{ github.ref_name }} &>/dev/null; then
43+
echo "Release already exists, skipping creation"
44+
else
45+
echo "Creating new release"
46+
gh release create ${{ github.ref_name }} --generate-notes
47+
fi
5248
env:
5349
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)