Skip to content

Commit feb5fbf

Browse files
authored
[build] Replace travis CI with circleci
circleci will also publish artifacts to github releases for all git tags
2 parents 4305f8b + 365968d commit feb5fbf

File tree

3 files changed

+89
-15
lines changed

3 files changed

+89
-15
lines changed

.circleci/config.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
version: 2
2+
jobs:
3+
frontend:
4+
docker:
5+
- image: circleci/node:10.8.0
6+
steps:
7+
- checkout
8+
- run:
9+
name: "Install dependencies"
10+
command: npm install
11+
working_directory: ui
12+
- run:
13+
name: "Run tests"
14+
command: npm test
15+
working_directory: ui
16+
- run:
17+
name: "Build"
18+
command: npm run build
19+
working_directory: ui
20+
- persist_to_workspace:
21+
root: .
22+
paths:
23+
- ui/dist/*
24+
25+
backend:
26+
docker:
27+
- image: circleci/golang:1.10
28+
29+
working_directory: /go/src/github.com/RoboCup-SSL/ssl-game-controller
30+
steps:
31+
- checkout
32+
- attach_workspace:
33+
at: .
34+
- run: go get -v -t -d ./...
35+
- run: go test -v ./...
36+
- run:
37+
working_directory: cmd/ssl-game-controller
38+
command: |
39+
go get -v github.com/gobuffalo/packr/packr
40+
GOOS=linux GOARCH=amd64 packr build -o ../../release/ssl-game-controller_linux_amd64
41+
GOOS=darwin GOARCH=amd64 packr build -o ../../release/ssl-game-controller_darwin_amd64
42+
GOOS=windows GOARCH=amd64 packr build -o ../../release/ssl-game-controller_windows_amd64.exe
43+
- persist_to_workspace:
44+
root: .
45+
paths:
46+
- release/*
47+
48+
publish-github-release:
49+
docker:
50+
- image: circleci/golang:1.10
51+
steps:
52+
- attach_workspace:
53+
at: .
54+
- run:
55+
name: "Prepare artifacts"
56+
working_directory: release
57+
command: |
58+
mv ssl-game-controller_linux_amd64 ssl-game-controller_${CIRCLE_TAG}_linux_amd64
59+
mv ssl-game-controller_darwin_amd64 ssl-game-controller_${CIRCLE_TAG}_darwin_amd64
60+
mv ssl-game-controller_windows_amd64.exe ssl-game-controller_${CIRCLE_TAG}_windows_amd64.exe
61+
- run:
62+
name: "Publish Release on GitHub"
63+
command: |
64+
go get github.com/tcnksm/ghr
65+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./release/
66+
67+
workflows:
68+
version: 2
69+
main:
70+
jobs:
71+
- frontend:
72+
filters:
73+
tags:
74+
only: /.*/
75+
- backend:
76+
requires:
77+
- frontend
78+
filters:
79+
tags:
80+
only: /.*/
81+
- publish-github-release:
82+
requires:
83+
- backend
84+
filters:
85+
branches:
86+
ignore: /.*/
87+
tags:
88+
only: /^v.*/

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![travis build](https://travis-ci.org/RoboCup-SSL/ssl-game-controller.svg?branch=master "travis build status")
1+
[![CircleCI](https://circleci.com/gh/RoboCup-SSL/ssl-game-controller/tree/master.svg?style=svg)](https://circleci.com/gh/RoboCup-SSL/ssl-game-controller/tree/master)
22
[![Go Report Card](https://goreportcard.com/badge/github.com/RoboCup-SSL/ssl-game-controller?style=flat-square)](https://goreportcard.com/report/github.com/RoboCup-SSL/ssl-game-controller)
33
[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/RoboCup-SSL/ssl-game-controller/internal/app/controller)
44
[![Release](https://img.shields.io/github/release/golang-standards/project-layout.svg?style=flat-square)](https://github.com/RoboCup-SSL/ssl-game-controller/releases/latest)

0 commit comments

Comments
 (0)