File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Go
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ tags : ["v*.*.*"]
7+ pull_request :
8+ branches : [ main ]
9+
10+ jobs :
11+
12+ build :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v2
16+
17+ - name : Set up Go
18+ uses : actions/setup-go@v2
19+ with :
20+ go-version : 1.17
21+
22+ - name : Build
23+ run : |
24+ build() {
25+ export GOOS=$1
26+ export GOARCH=$2
27+ go build -ldflags "-s -w" -o build/cert-copier-${1}-${2}${3} main.go
28+ }
29+ build linux amd64
30+ build windows amd64 .exe
31+ build windows 386 .exe
32+ build darwin amd64
33+ build darwin arm64
34+ - name : Upload a Build Artifact
35+ uses : actions/upload-artifact@v2.2.4
36+ with :
37+ path : build/*
38+ - name : Release
39+ uses : softprops/action-gh-release@v1
40+ if : startsWith(github.ref, 'refs/tags/')
41+ with :
42+ files : build/*
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
1111 "io/ioutil"
1212 "log"
1313 "os"
14+ "path/filepath"
1415 "regexp"
1516)
1617
@@ -108,7 +109,8 @@ var fileNameRegex = regexp.MustCompile(`[^a-zA-Z0-9_\-.]`)
108109
109110func main () {
110111 if len (os .Args ) != 2 {
111- log .Fatal ("usage: go run main.go $addr, for example: go run main.go github.com:443" )
112+ name := filepath .Base (os .Args [0 ])
113+ log .Fatalf ("usage: %s $addr, for example: %s github.com:443" , name , name )
112114 }
113115 certs , err := getCertsFromNetwork (os .Args [1 ])
114116 if err != nil {
You can’t perform that action at this time.
0 commit comments