diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..cafb3230 --- /dev/null +++ b/.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 }} diff --git a/Makefile b/Makefile index 0b4508b9..bca5c3b5 100644 --- a/Makefile +++ b/Makefile @@ -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