Skip to content

Commit

Permalink
Add github actions workdlow to create release
Browse files Browse the repository at this point in the history
  • Loading branch information
csyezheng committed Oct 20, 2023
1 parent 31a6ee6 commit 985396c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Create Release

on:
release:
types: [created]

permissions:
contents: write
packages: write

jobs:
releases-matrix:
name: Create Release
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.2'

- name: Create Release
uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://go.dev/dl/go1.21.2.linux-amd64.tar.gz"
project_path: "./cmd"
binary_name: "ip-scanner"
extra_files: LICENSE README.md configs data
1 change: 1 addition & 0 deletions common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func printResult(scanRecords ScanRecordArray, config *Config) {
if len(head) > 10 {
head = head[:10]
}
fmt.Printf("%s\t%s\t%s\t%s\n", "IP", "Protocol", "PingRTT", "HttpRTT")
for _, record := range head {
fmt.Printf("%s\t%s\t%f\t%f\n", record.IP, record.Protocol, record.PingRTT, record.HttpRTT)
}
Expand Down

0 comments on commit 985396c

Please sign in to comment.