Skip to content

Commit

Permalink
CI: build for all branches & use goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
geigi committed Nov 13, 2020
1 parent d30b4e8 commit 71eaf32
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
create:
tags:

Expand All @@ -21,35 +19,23 @@ jobs:
run: |
cd web
yarn install
yarn build
yarn buildk
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Install CLI tools
env:
GO111MODULE: off
run: |
go get github.com/swaggo/swag/cmd/swag
go get github.com/GeertJohan/go.rice/rice
- name: Test
run: |
cd api/
swag init
cp config.example.yaml config.yaml
go test -v ./... -cover
- name: Build
if: "!startsWith(github.ref, 'refs/tags/v')"
run: |
cd api/
swag init
rice embed-go
go build -v .
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: build --snapshot
workdir: ./api
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release
if: startsWith(github.ref, 'refs/tags/v')
Expand Down

0 comments on commit 71eaf32

Please sign in to comment.