-
Notifications
You must be signed in to change notification settings - Fork 107
131 lines (122 loc) · 3.8 KB
/
Copy pathci.yml
File metadata and controls
131 lines (122 loc) · 3.8 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
- run: govulncheck ./...
- run: go vet ./...
- run: go test ./...
- run: go build ./...
race:
name: Race test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- run: go test -race ./...
lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
workflow-lint:
name: GitHub Actions workflow lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
- run: actionlint
release-build:
name: Release binary build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
- run: govulncheck ./...
- run: ./build.sh
env:
VERSION: ci
- run: ./packaging/package-release.sh ci
docs:
name: Generated docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- run: go run ./tools/gen-docs
- run: go run ./tools/gen-json-schemas
- run: git diff --exit-code docs/commands
- run: git diff --exit-code docs/json-schema/v1
- run: test -z "$(git status --porcelain -- docs/commands)"
- run: test -z "$(git status --porcelain -- docs/json-schema/v1)"
chocolatey:
name: Chocolatey package
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- name: Build Windows binary
shell: pwsh
run: |
New-Item -ItemType Directory -Force dist | Out-Null
go build -ldflags "-s -w -X main.version=0.0.1" -o dist/dbxcli-windows-amd64.exe .
- name: Package Windows archive
shell: bash
env:
TARGETS: windows/amd64
run: ./packaging/package-release.sh 0.0.1
- name: Pack and install Chocolatey package
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
$zip = Resolve-Path .\dist\dbxcli_0.0.1_windows_amd64.zip
$checksum = (Get-FileHash $zip -Algorithm SHA256).Hash.ToLowerInvariant()
choco pack .\packaging\chocolatey\dbxcli\dbxcli.nuspec --version 0.0.1 --outputdirectory .\dist
$env:DBXCLI_CHOCOLATEY_URL64 = $zip.Path
$env:DBXCLI_CHOCOLATEY_CHECKSUM64 = $checksum
choco install dbxcli --source (Resolve-Path .\dist).Path --version 0.0.1 -y --no-progress
dbxcli --help
choco uninstall dbxcli -y --no-progress