Skip to content

Commit 985396c

Browse files
committed
Add github actions workdlow to create release
1 parent 31a6ee6 commit 985396c

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Create Release
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
permissions:
11+
contents: write
12+
packages: write
13+
14+
jobs:
15+
releases-matrix:
16+
name: Create Release
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
goos: [linux, windows, darwin]
21+
goarch: [amd64]
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v4
28+
with:
29+
go-version: '1.21.2'
30+
31+
- name: Create Release
32+
uses: wangyoucao577/go-release-action@v1
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
goos: ${{ matrix.goos }}
36+
goarch: ${{ matrix.goarch }}
37+
goversion: "https://go.dev/dl/go1.21.2.linux-amd64.tar.gz"
38+
project_path: "./cmd"
39+
binary_name: "ip-scanner"
40+
extra_files: LICENSE README.md configs data

common/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func printResult(scanRecords ScanRecordArray, config *Config) {
114114
if len(head) > 10 {
115115
head = head[:10]
116116
}
117+
fmt.Printf("%s\t%s\t%s\t%s\n", "IP", "Protocol", "PingRTT", "HttpRTT")
117118
for _, record := range head {
118119
fmt.Printf("%s\t%s\t%f\t%f\n", record.IP, record.Protocol, record.PingRTT, record.HttpRTT)
119120
}

0 commit comments

Comments
 (0)