Skip to content

Commit e2e2ce8

Browse files
der-eismannmrkenkeller
authored andcommitted
Migrate to GitHub actions (rebuy-de#587)
* Migrate to GitHub actions * Install golint * Don't fetch all tags for normal builds * Build zips for Windows * Build & upload release assets * Remove travis * Add job names
1 parent f5b51be commit e2e2ce8

File tree

4 files changed

+67
-29
lines changed

4 files changed

+67
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Golang CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
schedule:
9+
- cron: '15 3 * * 0'
10+
11+
jobs:
12+
build:
13+
name: CI Build
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Setup Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: '1.15'
20+
- name: Setup tools
21+
run: |
22+
go get golang.org/x/lint/golint
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
- name: Test Project
26+
run: |
27+
make test
28+
- name: Build Project
29+
run: |
30+
make

.github/workflows/release.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish release artifacts
2+
3+
on:
4+
release:
5+
type: [created]
6+
7+
jobs:
8+
release:
9+
name: Publish binaries
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Setup Go
13+
uses: actions/setup-go@v2
14+
with:
15+
go-version: '1.15'
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- name: Build Project binaries
21+
env:
22+
CGO_ENABLED: 0
23+
run: |
24+
make xc
25+
- name: Upload binaries to release
26+
uses: svenstaro/upload-release-action@v2
27+
with:
28+
repo_token: ${{ secrets.GITHUB_TOKEN }}
29+
file: dist/aws*
30+
tag: ${{ github.ref }}
31+
overwrite: true
32+
file_glob: true

.travis.yml

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

golang.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ GOPKGS=$(shell go list ./...)
2525

2626
OUTPUT_FILE=$(NAME)-$(BUILD_VERSION)-$(shell go env GOOS)-$(shell go env GOARCH)$(shell go env GOARM)$(shell go env GOEXE)
2727
OUTPUT_LINK=$(NAME)$(shell go env GOEXE)
28+
WINDOWS_ZIP=$(shell echo $(OUTPUT_FILE) | sed 's/\.exe/\.zip/')
2829

2930
default: build
3031

@@ -69,7 +70,11 @@ build: go_generate _build
6970
$(foreach TARGET,$(TARGETS),ln -sf $(OUTPUT_FILE) dist/$(OUTPUT_LINK);)
7071

7172
compress: _build
73+
ifeq ($(GOOS),windows)
74+
zip -j dist/$(WINDOWS_ZIP) dist/$(OUTPUT_FILE)
75+
else
7276
tar czf dist/$(OUTPUT_FILE).tar.gz -C dist $(OUTPUT_FILE)
77+
endif
7378
rm -f dist/$(OUTPUT_FILE)
7479

7580
xc: go_generate

0 commit comments

Comments
 (0)