Travis CI auto build to release

This commit is contained in:
n0vad3v 2020-02-28 20:21:42 +08:00 committed by Benny~
parent 810fba5c89
commit 73884394d9
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
2 changed files with 26 additions and 18 deletions

View File

@ -2,23 +2,18 @@ language: go
go: go:
- 1.13 - 1.13
env: GO111MODULE=on
jobs: script: GOARCH=amd64 go build -o webp-server-linux-amd64 webp-server.go
include:
- stage: test-build
skip_cleanup: true
script: go build -o webp-server-linux-amd64 webp-server.go
script: ls
- stage: GitHub Release deploy:
script: echo "Deploying to GitHub releases ..." provider: releases
deploy: api_key: $GITHUB_OAUTH_TOKEN
provider: releases skip_cleanup: true
api_key: $GITHUB_OAUTH_TOKEN file:
skip_cleanup: true - webp-server-linux-amd64
file: on:
- webp-server repo: webp-sh/webp_server_go
on: tags: true
repo: webp-sh/webp_server_go branch: master
tags: false
branch: add-travis-ci

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=webp-server
BINARY_LINUX=$(BINARY_NAME)_linux-amd64
all: build
build:
$(GOBUILD) -o $(BINARY_LINUX) -v
test:
$(GOTEST) -v ./...