Skip to content

Commit 799e33d

Browse files
committed
Add GitHub Action to publish the binary to GitHub releases
1 parent f4ba597 commit 799e33d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build and publish
2+
on: [push]
3+
# push:
4+
# branches:
5+
# - main
6+
jobs:
7+
publish-binary:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Setup Go
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: '^1.17'
17+
18+
- name: Build binary
19+
run: |
20+
go version
21+
go build .
22+
23+
- name: Create release
24+
id: create_release
25+
uses: actions/create-release@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
tag_name: latest
30+
release_name: ${{ github.ref }}
31+
draft: false
32+
prerelease: false
33+
34+
- uses: actions/upload-release-asset@v1.0.1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
upload_url: ${{ steps.create_release.outputs.upload_url }}
39+
asset_path: ./ipfs-check
40+
asset_name: ipfs-check
41+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)