File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Build Check
1+ name : Code Check
22
33on :
44 push :
Original file line number Diff line number Diff line change 1- # Workflow 2.0
2- #
3-
4- name : Build Status
1+ name : Build
52
63on :
74 push :
@@ -13,7 +10,6 @@ permissions:
1310
1411jobs :
1512 build :
16- name : Build and Release
1713 runs-on : ubuntu-latest
1814
1915 strategy :
@@ -22,15 +18,13 @@ jobs:
2218 goarch : [amd64, arm64]
2319
2420 steps :
25- - name : Checkout
26- uses : actions/checkout@v4
21+ - uses : actions/checkout@v4
2722
28- - name : Setup Go
29- uses : actions/setup-go@v5
23+ - uses : actions/setup-go@v5
3024 with :
3125 go-version : " 1.22"
3226
33- - name : Get version from tag
27+ - name : Get version
3428 id : vars
3529 run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
3630
3933 GOOS : ${{ matrix.goos }}
4034 GOARCH : ${{ matrix.goarch }}
4135 run : |
36+ mkdir -p dist
4237 BINARY_NAME=finder
4338 VERSION=${{ steps.vars.outputs.VERSION }}
4439
5550 -ldflags="-s -w -X main.Version=${VERSION}" \
5651 ./cmd/finder
5752
53+ - uses : actions/upload-artifact@v4
54+ with :
55+ name : build-${{ matrix.goos }}-${{ matrix.goarch }}
56+ path : dist/*
57+
58+ release :
59+ needs : build
60+ runs-on : ubuntu-latest
61+
62+ steps :
63+ - uses : actions/download-artifact@v4
64+ with :
65+ path : dist
66+
67+ - name : Flatten artifacts
68+ run : |
69+ mkdir release
70+ find dist -type f -exec mv {} release/ \;
71+
5872 - name : Archive
5973 run : |
60- cd dist
74+ cd release
6175 for file in *; do
6276 if [[ "$file" == *.exe ]]; then
6377 zip "${file}.zip" "$file"
7185 - name : Create Release
7286 uses : softprops/action-gh-release@v2
7387 with :
74- files : dist /*
88+ files : release /*
7589 env :
7690 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments