Skip to content

Commit

Permalink
Merge pull request #51 from jsuchome/release
Browse files Browse the repository at this point in the history
Create relase action, update Makefile to build for more archs
  • Loading branch information
Jiří Suchomel committed May 21, 2021
2 parents a508eac + bbee33e commit 051f6df
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 3 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,56 @@
name: Release-pipeline

on:
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch Branch
id: branch
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw##*/}
echo "::set-output name=BRANCH_NAME::$branch"
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.13.7'
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Install dependencies
if: steps.branch.outputs.BRANCH_NAME == 'main'
run: |
make deps
- 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 )
- name: Generate Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
pullRequests: "false"
onlyLastTag: "true"
stripGeneratorNotice: "true"
issuesWoLabels: "true"
stripHeaders: "true"
- name: Release fuseml-core
uses: softprops/action-gh-release@v1
if: steps.branch.outputs.BRANCH_NAME == 'main'
with:
files: ./bin/*
body_path: ./CHANGELOG.md
prerelease: "true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 22 additions & 3 deletions Makefile
Expand Up @@ -10,17 +10,36 @@ endif

GO_LDFLAGS:=-ldflags '-s -w'

all: fuseml
all: fuseml_all

# Run tests
test: generate lint
go test ./... -coverprofile cover.out

# Build FuseML binaries
fuseml: 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

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

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-amd64:
GOARCH="amd64" GOOS="linux" go build ${GO_LDFLAGS} -o bin/fuseml_core-cli-linux-amd64 ./cmd/fuseml_core-cli

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

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

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

0 comments on commit 051f6df

Please sign in to comment.