Merge pull request #351 from dropbox/feature/dry-run-share-link #242
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@v6 | |
| 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@v6 | |
| 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@v6 | |
| 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@v6 | |
| 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@v6 | |
| 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@v6 | |
| 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@v6 | |
| 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 |