-
Notifications
You must be signed in to change notification settings - Fork 107
72 lines (67 loc) · 2.06 KB
/
Copy pathci.yml
File metadata and controls
72 lines (67 loc) · 2.06 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
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@v6
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- run: go vet ./...
- run: go test ./...
- run: go build ./...
release-build:
name: Release binary build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- run: ./build.sh
env:
VERSION: ci
- run: ./packaging/package-release.sh ci
chocolatey:
name: Chocolatey package
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- 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