Skip to content

Commit c8de888

Browse files
committed
v2
0 parents  commit c8de888

File tree

7 files changed

+1407
-0
lines changed

7 files changed

+1407
-0
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
# Controls when the workflow will run
4+
on:
5+
release:
6+
types: [published]
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: ^1.17.1
21+
22+
- name: Cache go module
23+
uses: actions/cache@v2
24+
with:
25+
path: |
26+
~/.cache/go-build
27+
~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
31+
32+
- name: Build
33+
if: startsWith(github.ref, 'refs/tags/')
34+
env:
35+
NAME: oci-help
36+
BINDIR: build
37+
run: |
38+
make release -j$(nproc)
39+
40+
- name: Upload Release
41+
uses: softprops/action-gh-release@v1
42+
if: startsWith(github.ref, 'refs/tags/')
43+
with:
44+
files: build/*.zip

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
.DS_Store
18+
19+
*.pem
20+
build/
21+
example/

Makefile

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
NAME := oci-help
2+
PACKAGE_NAME := github.com/lemoex/oci-help
3+
VERSION := $(shell git describe --tags || echo "unknown-version")
4+
COMMIT := $(shell git rev-parse HEAD)
5+
BUILDTIME := $(shell date -u "+%Y-%m-%d %H:%M:%S %Z")
6+
BUILD_DIR := build
7+
VAR_SETTING := -X "$(PACKAGE_NAME)/constant.Version=$(VERSION)" -X "$(PACKAGE_NAME)/constant.Commit=$(COMMIT)" -X "$(PACKAGE_NAME)/constant.BuildTime=$(BUILDTIME)"
8+
GOBUILD = CGO_ENABLED=0 go build -trimpath -ldflags '-s -w -buildid= $(VAR_SETTING)' \
9+
-o $(BUILD_DIR)
10+
11+
PLATFORM_LIST = \
12+
darwin-amd64 \
13+
darwin-arm64 \
14+
linux-amd64 \
15+
linux-arm64 \
16+
windows-amd64 \
17+
windows-arm64
18+
19+
20+
zip_release = $(addsuffix .zip, $(PLATFORM_LIST))
21+
22+
23+
.PHONY: build clean release
24+
normal: clean build
25+
26+
clean:
27+
@rm -rf $(BUILD_DIR)
28+
@echo "Cleaning up."
29+
30+
$(zip_release): %.zip : %
31+
@zip -du $(BUILD_DIR)/$(NAME)-$<-$(VERSION).zip -j -m $(BUILD_DIR)/$</$(NAME)*
32+
@zip -du $(BUILD_DIR)/$(NAME)-$<-$(VERSION).zip *.ini
33+
@-zip -du $(BUILD_DIR)/$(NAME)-$<-$(VERSION).zip README.md
34+
@echo "$(NAME)-$<-$(VERSION).zip"
35+
36+
all: linux-amd64 darwin-amd64 windows-amd64 # Most used
37+
38+
all-arch: $(PLATFORM_LIST)
39+
40+
release: $(zip_release)
41+
42+
build:
43+
@-mkdir -p $(BUILD_DIR)
44+
$(GOBUILD)/$(NAME)
45+
46+
darwin-amd64:
47+
mkdir -p $(BUILD_DIR)/$@
48+
GOARCH=amd64 GOOS=darwin $(GOBUILD)/$@/$(NAME)
49+
50+
darwin-arm64:
51+
mkdir -p $(BUILD_DIR)/$@
52+
GOARCH=arm64 GOOS=darwin $(GOBUILD)/$@/$(NAME)
53+
54+
linux-386:
55+
mkdir -p $(BUILD_DIR)/$@
56+
GOARCH=386 GOOS=linux $(GOBUILD)/$@/$(NAME)
57+
58+
linux-amd64:
59+
mkdir -p $(BUILD_DIR)/$@
60+
GOARCH=amd64 GOOS=linux $(GOBUILD)/$@/$(NAME)
61+
62+
linux-arm:
63+
mkdir -p $(BUILD_DIR)/$@
64+
GOARCH=arm GOOS=linux $(GOBUILD)/$@/$(NAME)
65+
66+
linux-armv5:
67+
mkdir -p $(BUILD_DIR)/$@
68+
GOARCH=arm GOOS=linux GOARM=5 $(GOBUILD)/$@/$(NAME)
69+
70+
linux-armv6:
71+
mkdir -p $(BUILD_DIR)/$@
72+
GOARCH=arm GOOS=linux GOARM=6 $(GOBUILD)/$@/$(NAME)
73+
74+
linux-armv7:
75+
mkdir -p $(BUILD_DIR)/$@
76+
GOARCH=arm GOOS=linux GOARM=7 $(GOBUILD)/$@/$(NAME)
77+
78+
linux-arm64:
79+
mkdir -p $(BUILD_DIR)/$@
80+
GOARCH=arm64 GOOS=linux $(GOBUILD)/$@/$(NAME)
81+
82+
linux-mips-softfloat:
83+
mkdir -p $(BUILD_DIR)/$@
84+
GOARCH=mips GOMIPS=softfloat GOOS=linux $(GOBUILD)/$@/$(NAME)
85+
86+
linux-mips-hardfloat:
87+
mkdir -p $(BUILD_DIR)/$@
88+
GOARCH=mips GOMIPS=hardfloat GOOS=linux $(GOBUILD)/$@/$(NAME)
89+
90+
linux-mipsle-softfloat:
91+
mkdir -p $(BUILD_DIR)/$@
92+
GOARCH=mipsle GOMIPS=softfloat GOOS=linux $(GOBUILD)/$@/$(NAME)
93+
94+
linux-mipsle-hardfloat:
95+
mkdir -p $(BUILD_DIR)/$@
96+
GOARCH=mipsle GOMIPS=hardfloat GOOS=linux $(GOBUILD)/$@/$(NAME)
97+
98+
linux-mips64:
99+
mkdir -p $(BUILD_DIR)/$@
100+
GOARCH=mips64 GOOS=linux $(GOBUILD)/$@/$(NAME)
101+
102+
linux-mips64le:
103+
mkdir -p $(BUILD_DIR)/$@
104+
GOARCH=mips64le GOOS=linux $(GOBUILD)/$@/$(NAME)
105+
106+
freebsd-386:
107+
mkdir -p $(BUILD_DIR)/$@
108+
GOARCH=386 GOOS=freebsd $(GOBUILD)/$@/$(NAME)
109+
110+
freebsd-amd64:
111+
mkdir -p $(BUILD_DIR)/$@
112+
GOARCH=amd64 GOOS=freebsd $(GOBUILD)/$@/$(NAME)
113+
114+
freebsd-arm64:
115+
mkdir -p $(BUILD_DIR)/$@
116+
GOARCH=arm64 GOOS=freebsd $(GOBUILD)/$@/$(NAME)
117+
118+
windows-386:
119+
mkdir -p $(BUILD_DIR)/$@
120+
GOARCH=386 GOOS=windows $(GOBUILD)/$@/$(NAME).exe
121+
122+
windows-amd64:
123+
mkdir -p $(BUILD_DIR)/$@
124+
GOARCH=amd64 GOOS=windows $(GOBUILD)/$@/$(NAME).exe
125+
126+
windows-arm:
127+
mkdir -p $(BUILD_DIR)/$@
128+
GOARCH=arm GOOS=windows $(GOBUILD)/$@/$(NAME).exe
129+
130+
windows-armv6:
131+
mkdir -p $(BUILD_DIR)/$@
132+
GOARCH=arm GOOS=windows GOARM=6 $(GOBUILD)/$@/$(NAME).exe
133+
134+
windows-armv7:
135+
mkdir -p $(BUILD_DIR)/$@
136+
GOARCH=arm GOOS=windows GOARM=7 $(GOBUILD)/$@/$(NAME).exe
137+
138+
windows-arm64:
139+
mkdir -p $(BUILD_DIR)/$@
140+
GOARCH=arm64 GOOS=windows $(GOBUILD)/$@/$(NAME).exe

go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module oci-help
2+
3+
go 1.17
4+
5+
require (
6+
github.com/oracle/oci-go-sdk/v49 v49.2.0
7+
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b // indirect
8+
gopkg.in/ini.v1 v1.63.2
9+
)

go.sum

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
2+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3+
github.com/oracle/oci-go-sdk/v49 v49.2.0 h1:l4PUk81EKdTDD4mDg5wrELpdWFqYeE9KYejfNgtsyUI=
4+
github.com/oracle/oci-go-sdk/v49 v49.2.0/go.mod h1:E8q2DXmXnSozLdXHUFF+o3L2gzcWbiFIPFYOYWdqOfc=
5+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7+
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b h1:br+bPNZsJWKicw/5rALEo67QHs5weyD5tf8WST+4sJ0=
8+
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
9+
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
10+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
11+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
12+
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
13+
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
14+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
15+
gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c=
16+
gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
17+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
18+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)