Skip to content

Commit 2cff0f3

Browse files
committed
impv: auto publish artifact
1 parent 0b0fdc4 commit 2cff0f3

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/build-release.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Go binaries for release
1+
name: Build Go binaries and upload to release
22

33
on:
44
release:
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
goos: [linux, darwin]
16-
goarch: [amd64, arm64] # You can modify this if you want other architectures like ARM
16+
goarch: [amd64, arm64]
1717

1818
steps:
1919
- name: Checkout code
@@ -22,14 +22,16 @@ jobs:
2222
- name: Set up Go
2323
uses: actions/setup-go@v4
2424
with:
25-
go-version: '1.22.6' # Set to Go version 1.22.6
26-
25+
go-version: '1.22.6'
26+
2727
- name: Build binary
2828
run: |
29-
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/${{ matrix.goos }}-${{ matrix.goarch }}/weave
29+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/weave-${{ matrix.goos }}-${{ matrix.goarch }}
3030
31-
- name: Upload binaries
32-
uses: actions/upload-artifact@v3
31+
- name: Upload binaries to GitHub release
32+
uses: actions/upload-release-asset@v1
3333
with:
34-
name: ${{ matrix.goos }}-${{ matrix.goarch }}-binary
35-
path: build/${{ matrix.goos }}-${{ matrix.goarch }}/weave
34+
upload_url: ${{ github.event.release.upload_url }}
35+
asset_path: build/weave-${{ matrix.goos }}-${{ matrix.goarch }}
36+
asset_name: weave-${{ matrix.goos }}-${{ matrix.goarch }}
37+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)