Skip to content

Commit

Permalink
Merge pull request #6 from DarthPestilane/improve/release-ci
Browse files Browse the repository at this point in the history
add gorelease to ci
  • Loading branch information
DarthPestilane authored Sep 13, 2021
2 parents d20e6f7 + 0f977df commit bcb3a25
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: actions

on: [ push, pull_request ]
on:
push:
branchs:
- 'master'
tags:
pull_request:

jobs:
lint:
Expand Down Expand Up @@ -30,6 +35,7 @@ jobs:
run: curl -XPOST --data 'repo=github.com/darthPestilane/easytcp' 'https://goreportcard.com/checks'

test:
needs: lint
env:
CGO_ENABLED: 0
strategy:
Expand All @@ -46,9 +52,6 @@ jobs:
with:
go-version: ${{ matrix.go-version}}

- name: Build
run: make build-all

- name: Test
run: make test-v

Expand All @@ -57,3 +60,19 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: .testCoverage.txt

release:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist --skip-announce --timeout=2m
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea/
.vscode/
vender/
dist/

*.exe
*.exe~
Expand Down
7 changes: 7 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
builds:
- skip: true

release:
draft: true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ else
go generate
endif

.PHONY: release-local
release-local:
goreleaser release --rm-dist --skip-announce --skip-publish --snapshot

.PHONY: clean
clean:
go clean -r -x -cache -i

0 comments on commit bcb3a25

Please sign in to comment.