Skip to content

Commit 09ed617

Browse files
committed
Fix Workflow
1 parent 97afb7d commit 09ed617

2 files changed

Lines changed: 27 additions & 13 deletions

File tree

.github/workflows/buildcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Check
1+
name: Code Check
22

33
on:
44
push:

.github/workflows/release.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# Workflow 2.0
2-
#
3-
4-
name: Build Status
1+
name: Build
52

63
on:
74
push:
@@ -13,7 +10,6 @@ permissions:
1310

1411
jobs:
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

@@ -39,6 +33,7 @@ jobs:
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
@@ -55,9 +50,28 @@ jobs:
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"
@@ -71,6 +85,6 @@ jobs:
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 }}

0 commit comments

Comments
 (0)