Skip to content

Commit cf6b4a7

Browse files
authored
Merge pull request #543 from twpayne/release-improvements
Release improvements
2 parents 3e733b1 + 87881f2 commit cf6b4a7

File tree

4 files changed

+37
-66
lines changed

4 files changed

+37
-66
lines changed

.github/workflows/main.yml

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,35 @@ on:
22
pull_request:
33
push:
44
jobs:
5-
ubuntu-ci:
6-
runs-on: ubuntu-latest
5+
test:
6+
strategy:
7+
matrix:
8+
go-version:
9+
- 1.13.x
10+
os:
11+
- macos-latest
12+
- ubuntu-latest
13+
- windows-latest
14+
runs-on: ${{ matrix.os }}
715
steps:
816
- name: Set up Go
917
uses: actions/setup-go@v1
1018
with:
11-
go-version: 1.13.x
19+
go-version: ${{ matrix.go-version }}
1220
- name: Checkout
1321
uses: actions/checkout@v1
1422
- name: Download Go modules
1523
run: go mod download
1624
- name: Install tools
25+
if: matrix.os == 'ubuntu-latest'
1726
run: |
18-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
27+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2
1928
cd $(mktemp -d)
2029
go mod init tmp
2130
go get github.com/gobuffalo/packr/v2/packr2
2231
go get mvdan.cc/gofumpt/gofumports
2332
- name: Generate
33+
if: matrix.os == 'ubuntu-latest'
2434
run: |
2535
$(go env GOPATH)/bin/packr2
2636
go generate ./...
@@ -32,57 +42,31 @@ jobs:
3242
- name: Test
3343
run: go test -race ./...
3444
- name: Lint
45+
if: matrix.os == 'ubuntu-latest'
3546
run: $(go env GOPATH)/bin/golangci-lint run
3647
- name: Check formatting
48+
if: matrix.os == 'ubuntu-latest'
3749
run: |
3850
find . -name \*.go | xargs $(go env GOPATH)/bin/gofumports -w
3951
git diff --exit-code
4052
- name: Check completions
53+
if: matrix.os == 'ubuntu-latest'
4154
run: |
4255
go run . completion bash > completions/chezmoi-completion.bash
4356
go run . completion fish > completions/chezmoi.fish
4457
go run . completion zsh > completions/chezmoi.zsh
4558
git diff --exit-code
46-
macos-ci:
47-
runs-on: macos-latest
48-
steps:
49-
- name: Set up Go
50-
uses: actions/setup-go@v1
51-
with:
52-
go-version: 1.13.x
53-
- name: Checkout
54-
uses: actions/checkout@v1
55-
- name: Download Go modules
56-
run: go mod download
57-
- name: Build
58-
run: go build ./...
59-
- name: Run
60-
run: go run . --version
61-
- name: Test
62-
run: go test -race ./...
63-
windows-ci:
64-
runs-on: windows-latest
65-
steps:
66-
- name: Set up Go
67-
uses: actions/setup-go@v1
68-
with:
69-
go-version: 1.13.x
70-
- name: Checkout
71-
uses: actions/checkout@v1
72-
- name: Download Go modules
73-
run: go mod download
74-
- name: Build
75-
run: go build ./...
76-
- name: Run
77-
run: go run . --version
78-
- name: Test
79-
run: go test -race ./...
59+
- name: Test release
60+
if: matrix.os == 'ubuntu-latest'
61+
run: |
62+
sudo chown root:root /
63+
sudo snap install goreleaser --classic
64+
sudo snap install snapcraft --classic
65+
goreleaser release --skip-publish --snapshot
8066
release:
8167
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
8268
needs:
83-
- ubuntu-ci
84-
- macos-ci
85-
- windows-ci
69+
- test
8670
runs-on: ubuntu-latest
8771
steps:
8872
- name: Set up Go
@@ -95,7 +79,7 @@ jobs:
9579
run: go mod download
9680
- name: Install tools
9781
run: |
98-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- v1.21.0
82+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- v1.22.2
9983
cd $(mktemp -d)
10084
go mod init tmp
10185
go get github.com/gobuffalo/packr/v2/packr2

.golangci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ linters:
22
enable-all: true
33
disable:
44
- funlen
5+
- gochecknoglobals
56
- gocognit
67
- goconst
78
- gocyclo
89
- godox
10+
- gomnd
911
- lll
1012
- maligned
1113
- wsl
@@ -19,12 +21,8 @@ issues:
1921
- dupl
2022
path: "secretpass.go"
2123
- linters:
22-
- gochecknoglobals
2324
- gochecknoinits
2425
path: cmd/
25-
- linters:
26-
- gochecknoglobals
27-
path: internal/
2826
- linters:
2927
- scopelint
3028
path: "_test\\.go"

.goreleaser.yaml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,23 @@ builds:
2626
- openbsd
2727
- windows
2828
goarch:
29-
- "386"
29+
- 386
3030
- amd64
3131
- arm
3232
- arm64
3333
- ppc64
3434
- ppc64le
3535
goarm:
36-
- ""
36+
- 6
37+
- 7
3738
ignore:
3839
- goos: darwin
39-
goarch: "386"
40+
goarch: 386
4041
- goos: linux
4142
goarch: amd64
43+
- goos: linux
44+
goarch: arm
45+
goarm: 7
4246
- id: chezmoi-cgo-snap
4347
binary: chezmoi
4448
flags:
@@ -60,7 +64,7 @@ builds:
6064
goos:
6165
- linux
6266
goarch:
63-
- "386"
67+
- 386
6468
- arm64
6569

6670
archives:
@@ -78,21 +82,6 @@ archives:
7882
- goos: windows
7983
format: zip
8084

81-
checksum:
82-
name_template: "checksums.txt"
83-
84-
snapshot:
85-
name_template: "{{ .Tag }}-next"
86-
87-
changelog:
88-
sort: asc
89-
filters:
90-
exclude:
91-
- "^docs:"
92-
- "^test:"
93-
- "Merge pull request"
94-
- "Merge branch"
95-
9685
nfpms:
9786
- builds:
9887
- chezmoi-cgo

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ generate:
3535

3636
.PHONY: install-tools
3737
install-tools:
38-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- v1.21.0
38+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- v1.22.2
3939
GO111MODULE=off go get -u \
4040
github.com/gobuffalo/packr/v2/packr2 \
4141
mvdan.cc/gofumpt/gofumports

0 commit comments

Comments
 (0)