Skip to content

Commit bcb3a25

Browse files
Merge pull request #6 from DarthPestilane/improve/release-ci
add gorelease to ci
2 parents d20e6f7 + 0f977df commit bcb3a25

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.github/workflows/actions.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: actions
22

3-
on: [ push, pull_request ]
3+
on:
4+
push:
5+
branchs:
6+
- 'master'
7+
tags:
8+
pull_request:
49

510
jobs:
611
lint:
@@ -30,6 +35,7 @@ jobs:
3035
run: curl -XPOST --data 'repo=github.com/darthPestilane/easytcp' 'https://goreportcard.com/checks'
3136

3237
test:
38+
needs: lint
3339
env:
3440
CGO_ENABLED: 0
3541
strategy:
@@ -46,9 +52,6 @@ jobs:
4652
with:
4753
go-version: ${{ matrix.go-version}}
4854

49-
- name: Build
50-
run: make build-all
51-
5255
- name: Test
5356
run: make test-v
5457

@@ -57,3 +60,19 @@ jobs:
5760
with:
5861
token: ${{ secrets.CODECOV_TOKEN }}
5962
files: .testCoverage.txt
63+
64+
release:
65+
needs: test
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout Code
69+
uses: actions/checkout@v2
70+
71+
- name: Run GoReleaser
72+
uses: goreleaser/goreleaser-action@v2
73+
if: success() && startsWith(github.ref, 'refs/tags/')
74+
with:
75+
version: latest
76+
args: release --rm-dist --skip-announce --timeout=2m
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea/
22
.vscode/
33
vender/
4+
dist/
45

56
*.exe
67
*.exe~

.goreleaser.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This is an example .goreleaser.yml file with some sane defaults.
2+
# Make sure to check the documentation at http://goreleaser.com
3+
builds:
4+
- skip: true
5+
6+
release:
7+
draft: true

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ else
5757
go generate
5858
endif
5959

60+
.PHONY: release-local
61+
release-local:
62+
goreleaser release --rm-dist --skip-announce --skip-publish --snapshot
63+
6064
.PHONY: clean
6165
clean:
6266
go clean -r -x -cache -i

0 commit comments

Comments
 (0)