-
-
Notifications
You must be signed in to change notification settings - Fork 55
72 lines (59 loc) · 1.91 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Go
on:
pull_request:
push:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/rsteube/carapace
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Generate
run: go generate ./cmd/...
- name: Build
run: go build -v ./cmd/...
- name: Test
run: go test -v ./cmd/...
- name: "Check formatting"
run: '[ "$(gofmt -d -s . | tee -a /dev/stderr)" = "" ]'
- name: "staticcheck"
run: go install honnef.co/go/tools/cmd/[email protected] && staticcheck ./...
- name: "caralint"
run: go run ./cmd/caralint completers/*/cmd/*.go
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
GORELEASER_GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
doc:
runs-on: ubuntu-latest
container: ghcr.io/rsteube/carapace
steps:
- uses: actions/checkout@v2
- name: "build docs"
run: |
sed -i 's/\[output.linkcheck\]/#[output.linkcheck]/' docs/book.toml
sh .github/completers.sh > docs/src/completers.md
mdbook build docs
sh .github/badge.sh > docs/book/badge.svg
- name: "push gh-pages"
if: github.ref == 'refs/heads/master'
run: |
cd docs/book/
git init
git config user.name rsteube
git config user.email [email protected]
git add .
git commit -m "initial commit [ci skip]"
git push --force https://rsteube:${GITHUB_TOKEN}@github.com/rsteube/carapace-bin.git master:gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}