mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-07-04 00:00:21 -04:00
chore: add chocolatey (#4615)
This commit is contained in:
parent
1f46a118dc
commit
9d91e4a5a4
3 changed files with 52 additions and 6 deletions
22
.github/workflows/tag.yml
vendored
22
.github/workflows/tag.yml
vendored
|
@ -7,19 +7,30 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
# https://github.com/actions/setup-go#supported-version-syntax
|
||||||
|
# ex:
|
||||||
|
# - 1.18beta1 -> 1.18.0-beta.1
|
||||||
|
# - 1.18rc1 -> 1.18.0-rc.1
|
||||||
|
GO_VERSION: '1.22'
|
||||||
|
CHOCOLATEY_VERSION: 2.2.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
# https://github.com/actions/setup-go#supported-version-syntax
|
go-version: ${{ env.GO_VERSION }}
|
||||||
# ex:
|
|
||||||
# - 1.18beta1 -> 1.18.0-beta.1
|
|
||||||
# - 1.18rc1 -> 1.18.0-rc.1
|
|
||||||
go-version: '1.22'
|
|
||||||
- name: Unshallow
|
- name: Unshallow
|
||||||
run: git fetch --prune --unshallow
|
run: git fetch --prune --unshallow
|
||||||
|
|
||||||
|
- name: Install chocolatey
|
||||||
|
run: |
|
||||||
|
mkdir -p /opt/chocolatey
|
||||||
|
wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey"
|
||||||
|
echo '#!/bin/bash' >> /usr/local/bin/choco
|
||||||
|
echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco
|
||||||
|
chmod +x /usr/local/bin/choco
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
@ -35,4 +46,5 @@ jobs:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --clean --timeout=90m
|
args: release --clean --timeout=90m
|
||||||
env:
|
env:
|
||||||
|
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
|
||||||
|
|
|
@ -99,6 +99,32 @@ brews:
|
||||||
test: |
|
test: |
|
||||||
system "#{bin}/golangci-lint --version"
|
system "#{bin}/golangci-lint --version"
|
||||||
|
|
||||||
|
chocolateys:
|
||||||
|
- name: golangci-lint
|
||||||
|
owners: golangci
|
||||||
|
title: Golangci-lint
|
||||||
|
authors: golangci
|
||||||
|
project_url: https://golangci-lint.run
|
||||||
|
url_template: "https://github.com/golangci/golangci-lint/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
|
||||||
|
icon_url: "https://cdn.rawgit.com/golangci/golangci-lint/master/assets/go.png"
|
||||||
|
copyright: 2024 GolangCI
|
||||||
|
license_url: https://github.com/golangci/golangci-lint/blob/master/LICENSE
|
||||||
|
require_license_acceptance: false
|
||||||
|
project_source_url: https://github.com/golangci/golangci-lint
|
||||||
|
package_source_url: https://github.com/golangci/golangci-lint
|
||||||
|
docs_url: https://golangci-lint.run
|
||||||
|
bug_tracker_url: https://github.com/golangci/golangci-lint/issues
|
||||||
|
tags: "go golang lint linter"
|
||||||
|
summary: Fast linters Runner for Go
|
||||||
|
description: |
|
||||||
|
{{ .ProjectName }} installer package.
|
||||||
|
Fast linters Runner for Go .
|
||||||
|
release_notes: "https://github.com/golangci/golangci-lint/releases/tag/v{{ .Version }}"
|
||||||
|
api_key: "{{ .Env.CHOCOLATEY_API_KEY }}"
|
||||||
|
source_repo: "https://push.chocolatey.org/"
|
||||||
|
skip_publish: false
|
||||||
|
goamd64: v1
|
||||||
|
|
||||||
nfpms:
|
nfpms:
|
||||||
-
|
-
|
||||||
id: golangci-lint-nfpms
|
id: golangci-lint-nfpms
|
||||||
|
|
|
@ -9,7 +9,7 @@ Most installations of `golangci-lint` are performed for CI.
|
||||||
### GitHub Actions
|
### GitHub Actions
|
||||||
|
|
||||||
We recommend using [our GitHub Action](https://github.com/golangci/golangci-lint-action) for running `golangci-lint` in CI for GitHub projects.
|
We recommend using [our GitHub Action](https://github.com/golangci/golangci-lint-action) for running `golangci-lint` in CI for GitHub projects.
|
||||||
It's [fast and uses smart caching](https://github.com/golangci/golangci-lint-action#performance) inside
|
It's [fast and uses smart caching](https://github.com/golangci/golangci-lint-action#performance) inside,
|
||||||
and it can be much faster than the simple binary installation.
|
and it can be much faster than the simple binary installation.
|
||||||
|
|
||||||
Also, the action creates GitHub annotations for found issues: you don't need to dig into build log to see found by `golangci-lint` issues:
|
Also, the action creates GitHub annotations for found issues: you don't need to dig into build log to see found by `golangci-lint` issues:
|
||||||
|
@ -99,6 +99,14 @@ The macports installation mode is community driven, and not officially maintaine
|
||||||
sudo port install golangci-lint
|
sudo port install golangci-lint
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
You can install a binary on Windows using [chocolatey](https://community.chocolatey.org/packages/golangci-lint):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
choco install golangci-lint
|
||||||
|
```
|
||||||
|
|
||||||
### Install from Source
|
### Install from Source
|
||||||
|
|
||||||
Note: such `go install`/`go get` installation aren't guaranteed to work. We recommend using binary installation.
|
Note: such `go install`/`go get` installation aren't guaranteed to work. We recommend using binary installation.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue