Skip to content

Commit c87ea55

Browse files
committed
ci
1 parent 091d6e0 commit c87ea55

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: goreleaser
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
tags: ["v*"]
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
env:
16+
flags: ""
17+
steps:
18+
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
19+
run: echo "flags=--snapshot" >> $GITHUB_ENV
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
- uses: actions/setup-go@v4
24+
with:
25+
go-version: stable
26+
- uses: goreleaser/goreleaser-action@v4
27+
with:
28+
distribution: goreleaser
29+
version: latest
30+
args: release --clean ${{ env.flags }}
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
- uses: actions/upload-artifact@v3
34+
with:
35+
name: pping
36+
path: dist/*

.goreleaser.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1+
env:
2+
- GO111MODULE=on
13
before:
24
hooks:
3-
- go mod download
5+
- go mod tidy
46
builds:
57
- env:
68
- CGO_ENABLED=0
79
dir: cmd/pping
8-
goos:
9-
- linux
10-
- darwin
11-
- windows
12-
goarch:
13-
- "386"
14-
- amd64
15-
ignore:
16-
- goos: darwin
17-
goarch: "386"
10+
- targets: [go_first_class]
1811
archives:
1912
- name_template: >-
2013
{{ .ProjectName }}_

0 commit comments

Comments
 (0)