Skip to content

Commit 406b720

Browse files
authored
upload release assets (#7)
1 parent 421d720 commit 406b720

File tree

3 files changed

+54
-5
lines changed

3 files changed

+54
-5
lines changed

.github/workflows/test_and_build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: success()
2626
uses: actions/setup-go@v1
2727
with:
28-
go-version: 1.13.x
28+
go-version: 1.15.x
2929
- name: Checkout code
3030
uses: actions/checkout@v1
3131
- name: Run tests
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install Go
4949
uses: actions/setup-go@v1
5050
with:
51-
go-version: 1.13.x
51+
go-version: 1.15.x
5252
- name: Checkout code
5353
uses: actions/checkout@v1
5454
- name: build
@@ -74,5 +74,4 @@ jobs:
7474
name: bin
7575
- name: Run test
7676
run: |
77-
chmod 755 bin/gcov2lcov
7877
make inttest
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
name: Upload release assets
6+
jobs:
7+
build:
8+
name: build binaries
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Install Go
12+
uses: actions/setup-go@v1
13+
with:
14+
go-version: 1.13.x
15+
- name: Checkout code
16+
uses: actions/checkout@v1
17+
- name: build
18+
run: |
19+
export GO111MODULE=on
20+
make build
21+
for f in bin/*; do tar cvzf $f.tar.gz $f; rm $f; done
22+
cp README.md bin/
23+
- name: upload artifacts
24+
uses: actions/upload-artifact@master
25+
with:
26+
name: binaries
27+
path: bin/
28+
29+
upload:
30+
name: Upload release assets
31+
runs-on: ubuntu-latest
32+
needs: [build]
33+
steps:
34+
- name: Download build artefacts
35+
uses: actions/download-artifact@v1
36+
with:
37+
name: binaries
38+
path: bin/
39+
- name: Upload release assets
40+
uses: skx/github-action-publish-binaries@9f2ea568baec5017a7d608f03ef143a57745cc5c
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
args: './bin/*'

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
.PHONY: build test inttest
33

44
build:
5-
go build -o bin/gcov2lcov .
5+
GOOS=linux GOARCH=amd64 go build -o bin/gcov2lcov-linux-amd64 .
6+
GOOS=windows GOARCH=amd64 go build -o bin/gcov2lcov-win-amd64 .
7+
GOOS=darwin GOARCH=amd64 go build -o bin/gcov2lcov-darwin-amd64 .
68

79
test:
810
go test ./... -coverprofile coverage.out
911
go tool cover -func coverage.out
1012

1113
inttest: build
12-
./bin/gcov2lcov -infile testdata/coverage.out -outfile coverage.lcov
14+
./bin/gcov2lcov-linux-amd64 -infile testdata/coverage.out -outfile coverage.lcov
1315
diff -y testdata/coverage_expected.lcov coverage.lcov
1416

17+
clean:
18+
rm -f bin/*
19+
20+

0 commit comments

Comments
 (0)