Skip to content

Commit 9225a48

Browse files
authored
Replace travis by Github Actions as Linux / goreleaser CI (#301)
1 parent 3b38bd9 commit 9225a48

File tree

3 files changed

+43
-27
lines changed

3 files changed

+43
-27
lines changed

.github/workflows/go-ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Go
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
go-test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Set up Go
13+
uses: actions/setup-go@v2
14+
with:
15+
go-version: 1.15
16+
- run: go get -d -t ./...
17+
- run: go test -i ./...
18+
- run: go test -race -v ./...
19+
20+
goreleaser:
21+
runs-on: ubuntu-latest
22+
needs: go-test
23+
if: startsWith(github.ref, 'refs/tags/v')
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
with:
28+
fetch-depth: 0
29+
- name: Set up Go
30+
uses: actions/setup-go@v2
31+
with:
32+
go-version: 1.15
33+
- run: echo "${DOCKER_PASSWORD}" | docker login -u=sourcegraphci --password-stdin
34+
env:
35+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
36+
- name: Run GoReleaser
37+
uses: goreleaser/goreleaser-action@v2
38+
with:
39+
version: latest
40+
args: release --rm-dist
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

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

release.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if ! echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
77
exit 1
88
fi
99

10+
# Push a new tag, this will trigger the goreleaser workflow in .github/workflows/go-ci.yml
1011
git tag "${VERSION}" -a -m "release v${VERSION}"
1112
git tag latest -f -a -m "release v${VERSION}"
1213
git push -f --tags

0 commit comments

Comments
 (0)