Skip to content

Commit

Permalink
Merge pull request #19 from iftechio/platform
Browse files Browse the repository at this point in the history
Add platform option
  • Loading branch information
zxh326 authored Mar 18, 2022
2 parents 779c3f7 + 0f131b0 commit 9f67981
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 70 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
id: checkout
- name: Check out code into the Go module directory
uses: actions/checkout@v2
id: checkout

- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17

- name: Cache go module
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache go module
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies and run test
run: |
diff -u <(echo -n) <(gofmt -d ./pkg ./main.go)
go test -v -race ./...
- name: Get dependencies and run test
run: |
diff -u <(echo -n) <(gofmt -d ./pkg ./main.go)
go test -v -race ./...
- name: Build
if: startsWith(github.ref, 'refs/tags/')
run: make -j releases
- name: Build
if: startsWith(github.ref, 'refs/tags/')
run: make -j releases

- name: Upload Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: jki_v*
draft: false
prerelease: false
- name: Upload Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: jki_v*
draft: false
prerelease: false
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,24 @@ all:
$(GOBUILD) -o "$(NAME)_$(VERSION)_$(OS)_$(ARCH)/$(NAME)"
@tar czf "$(NAME)_$(VERSION)_$(OS)_$(ARCH).tar.gz" "$(NAME)_$(VERSION)_$(OS)_$(ARCH)"

.PHONY: linux_amd64 darwin_amd64 releases
.PHONY: linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 releases
linux_amd64:
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(NAME)_$(VERSION)_$@/$(NAME)
tar czf "$(NAME)_$(VERSION)_$@.tar.gz" "$(NAME)_$(VERSION)_$@"

linux_arm64:
GOARCH=arm64 GOOS=linux $(GOBUILD) -o $(NAME)_$(VERSION)_$@/$(NAME)
tar czf "$(NAME)_$(VERSION)_$@.tar.gz" "$(NAME)_$(VERSION)_$@"

darwin_amd64:
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(NAME)_$(VERSION)_$@/$(NAME)
tar czf "$(NAME)_$(VERSION)_$@.tar.gz" "$(NAME)_$(VERSION)_$@"

releases: linux_amd64 darwin_amd64
darwin_arm64:
GOARCH=arm64 GOOS=darwin $(GOBUILD) -o $(NAME)_$(VERSION)_$@/$(NAME)
tar czf "$(NAME)_$(VERSION)_$@.tar.gz" "$(NAME)_$(VERSION)_$@"

releases: linux_amd64 linux_arm64 darwin_amd64 darwin_arm64

.PHONY: install
install:
Expand Down
69 changes: 68 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/iftechio/jki

go 1.13
go 1.17

replace github.com/docker/docker => github.com/docker/engine v1.4.2-0.20200309214505-aa6a9891b09c

Expand All @@ -27,3 +27,70 @@ require (
k8s.io/client-go v0.18.2
sigs.k8s.io/yaml v1.2.0
)

require (
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect
github.com/Microsoft/hcsshim v0.8.7 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/containerd/cgroups v0.0.0-20200217135630-d732e370d46d // indirect
github.com/containerd/containerd v1.4.0-0 // indirect
github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v0.0.0-20200223014041-6b972e50feee // indirect
github.com/docker/go-connections v0.3.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/evanphx/json-patch v4.2.0+incompatible // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/jsonpointer v0.19.3 // indirect
github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-openapi/spec v0.19.3 // indirect
github.com/go-openapi/swag v0.19.5 // indirect
github.com/gofrs/flock v0.7.0 // indirect
github.com/gogo/googleapis v1.3.2 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.3.3 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 // indirect
github.com/googleapis/gnostic v0.1.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/json-iterator/go v1.1.8 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/opencontainers/runc v1.0.0-rc9.0.20200221051241-688cf6d43cc4 // indirect
github.com/opentracing/opentracing-go v0.0.0-20171003133519-1361b9cd60be // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
go.opencensus.io v0.22.0 // indirect
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.5.0 // indirect
google.golang.org/genproto v0.0.0-20200227132054-3f1135a288c9 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.42.0 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c // indirect
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 // indirect
sigs.k8s.io/kustomize v2.0.3+incompatible // indirect
sigs.k8s.io/structured-merge-diff/v3 v3.0.0 // indirect
)
Loading

0 comments on commit 9f67981

Please sign in to comment.