Skip to content

Commit f91ecad

Browse files
authored
Update golangci-lint, use gh for release assets upload (#70)
1 parent 857b4e2 commit f91ecad

5 files changed

Lines changed: 23 additions & 67 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project.
2626
Add `Makefile` to your module with includes standard targets.
2727

2828
```Makefile
29-
#GOLANGCI_LINT_VERSION := "v2.5.0" # Optional configuration to pinpoint golangci-lint version.
29+
#GOLANGCI_LINT_VERSION := "v2.11.3" # Optional configuration to pinpoint golangci-lint version.
3030

3131
# The head of Makefile determines location of dev-go to include standard targets.
3232
GO ?= go

makefiles/base.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#GOLANGCI_LINT_VERSION := "v2.5.0" # Optional configuration to pinpoint golangci-lint version.
1+
#GOLANGCI_LINT_VERSION := "v2.11.3" # Optional configuration to pinpoint golangci-lint version.
22

33
# The head of Makefile determines location of dev-go to include standard targets.
44
GO ?= go

scripts/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
[ -z "$GO" ] && GO=go
4-
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v2.5.0"
4+
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v2.11.3"
55

66
# detecting GOPATH and removing trailing "/" if any
77
GOPATH="$(go env GOPATH)"

templates/github/workflows/golangci-lint.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,6 @@ jobs:
2424
go-version: stable
2525
- uses: actions/checkout@v4
2626
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v8.0.0
27+
uses: golangci/golangci-lint-action@v9.2.0
2828
with:
29-
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
30-
version: v2.4.0
31-
32-
# Optional: working directory, useful for monorepos
33-
# working-directory: somedir
34-
35-
# Optional: golangci-lint command line arguments.
36-
# args: --issues-exit-code=0
37-
38-
# Optional: show only new issues if it's a pull request. The default value is `false`.
39-
# only-new-issues: true
40-
41-
# Optional: if set to true then the action will use pre-installed Go.
42-
# skip-go-installation: true
43-
44-
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
45-
# skip-pkg-cache: true
46-
47-
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
48-
# skip-build-cache: true
29+
version: v2.11.3

templates/github/workflows/release-assets.yml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
release:
77
types:
88
- created
9+
10+
permissions:
11+
contents: write # Required to upload assets
12+
913
env:
1014
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1115
GO_VERSION: stable
@@ -23,60 +27,31 @@ jobs:
2327
- name: Build artifacts
2428
run: |
2529
make release-assets
30+
2631
- name: Upload linux_amd64.tar.gz
2732
if: hashFiles('linux_amd64.tar.gz') != ''
28-
uses: actions/upload-release-asset@v1
29-
with:
30-
upload_url: ${{ github.event.release.upload_url }}
31-
asset_path: ./linux_amd64.tar.gz
32-
asset_name: linux_amd64.tar.gz
33-
asset_content_type: application/tar+gzip
33+
run: gh release upload "${{ github.event.release.tag_name }}" linux_amd64.tar.gz --clobber
34+
3435
- name: Upload linux_amd64_dbg.tar.gz
3536
if: hashFiles('linux_amd64_dbg.tar.gz') != ''
36-
uses: actions/upload-release-asset@v1
37-
with:
38-
upload_url: ${{ github.event.release.upload_url }}
39-
asset_path: ./linux_amd64_dbg.tar.gz
40-
asset_name: linux_amd64_dbg.tar.gz
41-
asset_content_type: application/tar+gzip
37+
run: gh release upload "${{ github.event.release.tag_name }}" linux_amd64_dbg.tar.gz --clobber
38+
4239
- name: Upload linux_arm64.tar.gz
4340
if: hashFiles('linux_arm64.tar.gz') != ''
44-
uses: actions/upload-release-asset@v1
45-
with:
46-
upload_url: ${{ github.event.release.upload_url }}
47-
asset_path: ./linux_arm64.tar.gz
48-
asset_name: linux_arm64.tar.gz
49-
asset_content_type: application/tar+gzip
41+
run: gh release upload "${{ github.event.release.tag_name }}" linux_arm64.tar.gz --clobber
42+
5043
- name: Upload linux_arm.tar.gz
5144
if: hashFiles('linux_arm.tar.gz') != ''
52-
uses: actions/upload-release-asset@v1
53-
with:
54-
upload_url: ${{ github.event.release.upload_url }}
55-
asset_path: ./linux_arm.tar.gz
56-
asset_name: linux_arm.tar.gz
57-
asset_content_type: application/tar+gzip
45+
run: gh release upload "${{ github.event.release.tag_name }}" linux_arm.tar.gz --clobber
46+
5847
- name: Upload darwin_amd64.tar.gz
5948
if: hashFiles('darwin_amd64.tar.gz') != ''
60-
uses: actions/upload-release-asset@v1
61-
with:
62-
upload_url: ${{ github.event.release.upload_url }}
63-
asset_path: ./darwin_amd64.tar.gz
64-
asset_name: darwin_amd64.tar.gz
65-
asset_content_type: application/tar+gzip
49+
run: gh release upload "${{ github.event.release.tag_name }}" darwin_amd64.tar.gz --clobber
50+
6651
- name: Upload darwin_arm64.tar.gz
6752
if: hashFiles('darwin_arm64.tar.gz') != ''
68-
uses: actions/upload-release-asset@v1
69-
with:
70-
upload_url: ${{ github.event.release.upload_url }}
71-
asset_path: ./darwin_arm64.tar.gz
72-
asset_name: darwin_arm64.tar.gz
73-
asset_content_type: application/tar+gzip
53+
run: gh release upload "${{ github.event.release.tag_name }}" darwin_arm64.tar.gz --clobber
54+
7455
- name: Upload windows_amd64.zip
7556
if: hashFiles('windows_amd64.zip') != ''
76-
uses: actions/upload-release-asset@v1
77-
with:
78-
upload_url: ${{ github.event.release.upload_url }}
79-
asset_path: ./windows_amd64.zip
80-
asset_name: windows_amd64.zip
81-
asset_content_type: application/zip
82-
57+
run: gh release upload "${{ github.event.release.tag_name }}" windows_amd64.zip --clobber

0 commit comments

Comments
 (0)