Skip to content

Commit 051f6df

Browse files
author
Jiří Suchomel
authored
Merge pull request #51 from jsuchome/release
Create relase action, update Makefile to build for more archs
2 parents a508eac + bbee33e commit 051f6df

File tree

2 files changed

+78
-3
lines changed

2 files changed

+78
-3
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release-pipeline
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Fetch Branch
17+
id: branch
18+
run: |
19+
raw=$(git branch -r --contains ${{ github.ref }})
20+
branch=${raw##*/}
21+
echo "::set-output name=BRANCH_NAME::$branch"
22+
- name: Setup Go
23+
uses: actions/setup-go@v2
24+
with:
25+
go-version: '^1.13.7'
26+
- name: Install Protoc
27+
uses: arduino/setup-protoc@v1
28+
- name: Install dependencies
29+
if: steps.branch.outputs.BRANCH_NAME == 'main'
30+
run: |
31+
make deps
32+
- name: Build binaries
33+
if: steps.branch.outputs.BRANCH_NAME == 'main'
34+
run: |
35+
make all
36+
- name: Create CHECKSUMS
37+
if: steps.branch.outputs.BRANCH_NAME == 'main'
38+
run: ( cd bin; sha256sum -b fuseml_core* > SHA256SUM.txt )
39+
- name: Generate Changelog
40+
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
41+
with:
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
pullRequests: "false"
44+
onlyLastTag: "true"
45+
stripGeneratorNotice: "true"
46+
issuesWoLabels: "true"
47+
stripHeaders: "true"
48+
- name: Release fuseml-core
49+
uses: softprops/action-gh-release@v1
50+
if: steps.branch.outputs.BRANCH_NAME == 'main'
51+
with:
52+
files: ./bin/*
53+
body_path: ./CHANGELOG.md
54+
prerelease: "true"
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,36 @@ endif
1010

1111
GO_LDFLAGS:=-ldflags '-s -w'
1212

13-
all: fuseml
13+
all: fuseml_all
1414

1515
# Run tests
1616
test: generate lint
1717
go test ./... -coverprofile cover.out
1818

19-
# Build FuseML binaries
20-
fuseml: generate lint
19+
# Generate code, run linter and build FuseML binaries
20+
fuseml: generate lint build
21+
22+
fuseml_all: generate lint build_all
23+
24+
build: build_server build_client_local
25+
26+
build_all: build_server build_client-amd64 build_client-windows build_client-darwin-amd64
27+
28+
build_server:
2129
go build ${GO_LDFLAGS} -o bin/fuseml_core ./cmd/fuseml_core
30+
31+
build_client_local:
2232
go build ${GO_LDFLAGS} -o bin/fuseml_core-cli ./cmd/fuseml_core-cli
2333

34+
build_client-amd64:
35+
GOARCH="amd64" GOOS="linux" go build ${GO_LDFLAGS} -o bin/fuseml_core-cli-linux-amd64 ./cmd/fuseml_core-cli
36+
37+
build_client-windows:
38+
GOARCH="amd64" GOOS="windows" go build ${GO_LDFLAGS} -o bin/fuseml_core-cli-windows-amd64 ./cmd/fuseml_core-cli
39+
40+
build_client-darwin-amd64:
41+
GOARCH="amd64" GOOS="darwin" go build ${GO_LDFLAGS} -o bin/fuseml_core-cli-darwin-amd64 ./cmd/fuseml_core-cli
42+
2443
# Run fuseml_core
2544
runcore: generate lint
2645
go run ./cmd/fuseml_core

0 commit comments

Comments
 (0)