-
Notifications
You must be signed in to change notification settings - Fork 107
92 lines (86 loc) · 3.04 KB
/
Copy pathrelease.yml
File metadata and controls
92 lines (86 loc) · 3.04 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
asset_version: ${{ steps.version.outputs.asset_version }}
windows_archive: ${{ steps.version.outputs.windows_archive }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25.12"
cache-dependency-path: go.sum
- name: Set release version
id: version
shell: bash
run: |
asset_version="${GITHUB_REF_NAME#v}"
echo "asset_version=${asset_version}" >> "$GITHUB_OUTPUT"
echo "windows_archive=dbxcli_${asset_version}_windows_amd64.zip" >> "$GITHUB_OUTPUT"
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
- run: govulncheck ./...
- uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
- run: go vet ./...
- run: go test ./...
- run: go build ./...
- run: mkdir -p dist
- run: ./build.sh
env:
VERSION: ${{ github.ref_name }}
- run: ./packaging/package-release.sh
env:
VERSION: ${{ github.ref_name }}
- name: Verify Windows release archive
run: test -f "dist/${{ steps.version.outputs.windows_archive }}"
- uses: softprops/action-gh-release@v3
with:
files: |
dist/*.tar.gz
dist/*.zip
dist/SHA256SUMS
winget:
name: Submit WinGet update
needs: release
runs-on: windows-latest
env:
VERSION: ${{ needs.release.outputs.asset_version }}
INSTALLER_URL: https://github.com/dropbox/dbxcli/releases/download/v${{ needs.release.outputs.asset_version }}/${{ needs.release.outputs.windows_archive }}
steps:
- uses: actions/setup-dotnet@v6
with:
dotnet-version: "9.0.x"
- name: Download WingetCreate
shell: pwsh
run: |
$url = "https://github.com/microsoft/winget-create/releases/download/v1.12.8.0/wingetcreate.exe"
Invoke-WebRequest -Uri $url -OutFile wingetcreate.exe
$expected = "8bd738851b524885410112678e3771b341c5c716de60fbbecb88ab0a363ed85d"
$actual = (Get-FileHash .\wingetcreate.exe -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actual -ne $expected) {
throw "WingetCreate checksum mismatch: expected $expected, got $actual"
}
- name: Submit WinGet manifest
shell: pwsh
env:
WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_CREATE_GITHUB_TOKEN }}
run: |
if ([string]::IsNullOrWhiteSpace($env:WINGET_CREATE_GITHUB_TOKEN)) {
throw "The WINGET_CREATE_GITHUB_TOKEN repository secret is not configured"
}
.\wingetcreate.exe update Dropbox.dbxcli `
--urls "$env:INSTALLER_URL|x64" `
--version $env:VERSION `
--release-notes-url "https://github.com/dropbox/dbxcli/releases/tag/v$env:VERSION" `
--submit `
--no-open