Skip to content

Commit

Permalink
Create separate archives for released CLI flavors
Browse files Browse the repository at this point in the history
  • Loading branch information
stefannica committed May 21, 2021
1 parent 2eeaed0 commit f8aa263
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
38 changes: 25 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
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,26 +22,35 @@ 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 ./cmd/fuseml_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-linux-amd64 ./cmd/fuseml_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-windows-amd64 ./cmd/fuseml_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-darwin-amd64 ./cmd/fuseml_cli
client_release-darwin-amd64:
$(MAKE) GOARCH="amd64" GOOS="darwin" client_release

# Run fuseml_core
runcore: generate lint
Expand Down

0 comments on commit f8aa263

Please sign in to comment.