Skip to content

Commit

Permalink
Merge pull request #55 from stefannica/fuseml-cli
Browse files Browse the repository at this point in the history
Rename fuseml_core-cli fuseml and create release archives
  • Loading branch information
stefannica committed May 21, 2021
2 parents 7b3691f + f8aa263 commit 5131395
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
target: ["all", "test"]
target: ["release", "test"]
steps:
- uses: actions/checkout@v2

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Expand Up @@ -32,10 +32,7 @@ jobs:
- name: Build binaries
if: steps.branch.outputs.BRANCH_NAME == 'main'
run: |
make all
- name: Create CHECKSUMS
if: steps.branch.outputs.BRANCH_NAME == 'main'
run: ( cd bin; sha256sum -b fuseml_core* > SHA256SUM.txt )
make release
- name: Generate Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
Expand Down
42 changes: 27 additions & 15 deletions Makefile
Expand Up @@ -8,9 +8,12 @@ else
GOBIN=$(shell go env GOBIN)
endif

GOOS:=$(shell go env GOOS)
GOARCH:=$(shell go env GOARCH)

GO_LDFLAGS:=-ldflags '-s -w'

all: fuseml_all
all: fuseml

# Run tests
test: generate lint
Expand All @@ -19,34 +22,43 @@ test: generate lint
# Generate code, run linter and build FuseML binaries
fuseml: generate lint build

fuseml_all: generate lint build_all

build: build_server build_client_local
# Generate code, run linter, build FuseML release-ready archived binaries for all supported ARCHs and OSs
release: generate lint release_all

build_all: build_server build_client-amd64 build_client-windows build_client-darwin-amd64
build: build_server build_client

build_server:
go build ${GO_LDFLAGS} -o bin/fuseml_core ./cmd/fuseml_core

build_client_local:
go build ${GO_LDFLAGS} -o bin/fuseml_core-cli ./cmd/fuseml_core-cli
build_client:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build ${GO_LDFLAGS} -o bin/fuseml ./cmd/fuseml_cli

release_all: server_release client_release-amd64 client_release-windows client_release-darwin-amd64

server_release: build_server
tar zcf bin/fuseml_core.tar.gz -C bin/ --remove-files --transform="s#\.\/##" ./fuseml_core
cd bin && sha256sum -b fuseml_core.tar.gz > fuseml_core.tar.gz.sha256

client_release: build_client
tar zcf bin/fuseml-$(GOOS)-$(GOARCH).tar.gz -C bin/ --remove-files --transform="s#\.\/##" ./fuseml
cd bin && sha256sum -b fuseml-$(GOOS)-$(GOARCH).tar.gz > fuseml-$(GOOS)-$(GOARCH).tar.gz.sha256

build_client-amd64:
GOARCH="amd64" GOOS="linux" go build ${GO_LDFLAGS} -o bin/fuseml_core-cli-linux-amd64 ./cmd/fuseml_core-cli
client_release-amd64:
$(MAKE) GOARCH="amd64" GOOS="linux" client_release

build_client-windows:
GOARCH="amd64" GOOS="windows" go build ${GO_LDFLAGS} -o bin/fuseml_core-cli-windows-amd64 ./cmd/fuseml_core-cli
client_release-windows:
$(MAKE) GOARCH="amd64" GOOS="windows" client_release

build_client-darwin-amd64:
GOARCH="amd64" GOOS="darwin" go build ${GO_LDFLAGS} -o bin/fuseml_core-cli-darwin-amd64 ./cmd/fuseml_core-cli
client_release-darwin-amd64:
$(MAKE) GOARCH="amd64" GOOS="darwin" client_release

# Run fuseml_core
runcore: generate lint
go run ./cmd/fuseml_core

# Run fuseml_core-cli
# Run fuseml_cli
runcli: generate lint
go run ./cmd/fuseml_core-cli
go run ./cmd/fuseml_cli

# Generate code
generate:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5131395

Please sign in to comment.