Skip to content

Commit 2dce15c

Browse files
committed
CI: 优化workflow
1 parent 5165805 commit 2dce15c

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

.github/workflows/docker.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Docker Image CI
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "v*.*.*"
77

88
jobs:
99
docker-hub:
@@ -68,28 +68,28 @@ jobs:
6868

6969
- name: Build
7070
run: |
71-
GOOS=linux GOARCH=amd64 go build -o busuanzi-linux-amd64
72-
GOOS=linux GOARCH=arm64 go build -o busuanzi-linux-arm64
73-
GOOS=darwin GOARCH=amd64 go build -o busuanzi-darwin-amd64
74-
GOOS=darwin GOARCH=arm64 go build -o busuanzi-darwin-arm64
75-
GOOS=windows GOARCH=amd64 go build -o busuanzi-windows-amd64.exe
76-
GOOS=windows GOARCH=arm64 go build -o busuanzi-windows-arm64.exe
77-
GOOS=windows GOARCH=386 go build -o busuanzi-windows-386.exe
71+
GOOS=linux GOARCH=amd64 go build -o busuanzi-linux-amd64-${{ github.ref_name }}
72+
GOOS=linux GOARCH=arm64 go build -o busuanzi-linux-arm64-${{ github.ref_name }}
73+
GOOS=darwin GOARCH=amd64 go build -o busuanzi-darwin-amd64-${{ github.ref_name }}
74+
GOOS=darwin GOARCH=arm64 go build -o busuanzi-darwin-arm64-${{ github.ref_name }}
75+
GOOS=windows GOARCH=amd64 go build -o busuanzi-windows-amd64-${{ github.ref_name }}.exe
76+
GOOS=windows GOARCH=arm64 go build -o busuanzi-windows-arm64-${{ github.ref_name }}.exe
77+
GOOS=windows GOARCH=386 go build -o busuanzi-windows-386-${{ github.ref_name }}.exe
7878
7979
- name: Archive
8080
uses: softprops/action-gh-release@v2
8181
if: startsWith(github.ref, 'refs/tags/')
8282
with:
8383
files: |
84-
busuanzi-linux-amd64
85-
busuanzi-linux-arm64
86-
busuanzi-darwin-amd64
87-
busuanzi-darwin-arm64
88-
busuanzi-windows-amd64.exe
89-
busuanzi-windows-arm64.exe
90-
busuanzi-windows-386.exe
84+
busuanzi-linux-amd64-${{ github.ref_name }}
85+
busuanzi-linux-arm64-${{ github.ref_name }}
86+
busuanzi-darwin-amd64-${{ github.ref_name }}
87+
busuanzi-darwin-arm64-${{ github.ref_name }}
88+
busuanzi-windows-amd64-${{ github.ref_name }}.exe
89+
busuanzi-windows-arm64-${{ github.ref_name }}.exe
90+
busuanzi-windows-386-${{ github.ref_name }}.exe
9191
token: ${{ secrets.GITHUB_TOKEN }}
92-
release_name: ${{ github.ref }}
93-
tag_name: ${{ github.ref }}
92+
release_name: ${{ github.ref_name }}
93+
tag_name: ${{ github.ref_name }}
9494
body: ${{ github.event.release.body }}
9595
draft: true

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Docker Build Test
22

33
on:
44
push:
5-
branches: [ "dev" ]
5+
branches: [ "dev", "main" ]
66
pull_request:
7-
branches: [ "dev" ]
7+
branches: [ "dev", "main" ]
88

99
jobs:
1010
docker-build:

0 commit comments

Comments
 (0)