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

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

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 ./...