Skip to content

Commit 334ba74

Browse files
committed
Fix CI: Add Go 1.22 support and update GitHub Actions
- Add Go 1.22 setup to both CI and release workflows - Update actions/checkout from v2 to v4 - Update actions/setup-go from v4 to v5 with cache enabled - Update staticcheck version from 2022.1.3 to 2023.1.6 - Fix YAML indentation and formatting - Resolves Go 1.22 compilation error
1 parent 2ed5b28 commit 334ba74

File tree

2 files changed

+69
-61
lines changed

2 files changed

+69
-61
lines changed

.github/workflows/release.yaml

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,70 @@ name: Build and release
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
99
releases-matrix:
1010
name: Release Go Binary
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- run: echo $(go env GOPATH)/bin >> $GITHUB_PATH
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-go@v5
15+
with:
16+
go-version: "1.22"
17+
cache: true
18+
- run: echo $(go env GOPATH)/bin >> $GITHUB_PATH
1519

16-
- name: Build collector
17-
run: UPX_COMPRESS=1 make collector
18-
- name: Build Windows binary
19-
run: make windows
20-
- name: Build Linux binary
21-
run: make linux
22-
- name: Build Darwin binary
23-
run: make darwin
20+
- name: Build collector
21+
run: UPX_COMPRESS=1 make collector
22+
- name: Build Windows binary
23+
run: make windows
24+
- name: Build Linux binary
25+
run: make linux
26+
- name: Build Darwin binary
27+
run: make darwin
2428

25-
- name: Upload Windows binary
26-
uses: svenstaro/upload-release-action@v2
27-
with:
28-
repo_token: ${{ secrets.GITHUB_TOKEN }}
29-
file: build/androidqf_windows_amd64.exe
30-
asset_name: androidqf_$tag_windows_amd64.exe
31-
tag: ${{ github.ref }}
32-
overwrite: true
29+
- name: Upload Windows binary
30+
uses: svenstaro/upload-release-action@v2
31+
with:
32+
repo_token: ${{ secrets.GITHUB_TOKEN }}
33+
file: build/androidqf_windows_amd64.exe
34+
asset_name: androidqf_$tag_windows_amd64.exe
35+
tag: ${{ github.ref }}
36+
overwrite: true
3337

34-
- name: Upload Linux binary
35-
uses: svenstaro/upload-release-action@v2
36-
with:
37-
repo_token: ${{ secrets.GITHUB_TOKEN }}
38-
file: build/androidqf_linux_amd64
39-
asset_name: androidqf_$tag_linux_amd64
40-
tag: ${{ github.ref }}
41-
overwrite: true
38+
- name: Upload Linux binary
39+
uses: svenstaro/upload-release-action@v2
40+
with:
41+
repo_token: ${{ secrets.GITHUB_TOKEN }}
42+
file: build/androidqf_linux_amd64
43+
asset_name: androidqf_$tag_linux_amd64
44+
tag: ${{ github.ref }}
45+
overwrite: true
4246

43-
- name: Upload Linux arm64 binary
44-
uses: svenstaro/upload-release-action@v2
45-
with:
46-
repo_token: ${{ secrets.GITHUB_TOKEN }}
47-
file: build/androidqf_linux_arm64
48-
asset_name: androidqf_$tag_linux_arm64
49-
tag: ${{ github.ref }}
50-
overwrite: true
47+
- name: Upload Linux arm64 binary
48+
uses: svenstaro/upload-release-action@v2
49+
with:
50+
repo_token: ${{ secrets.GITHUB_TOKEN }}
51+
file: build/androidqf_linux_arm64
52+
asset_name: androidqf_$tag_linux_arm64
53+
tag: ${{ github.ref }}
54+
overwrite: true
5155

52-
- name: Upload Darwin binary
53-
uses: svenstaro/upload-release-action@v2
54-
with:
55-
repo_token: ${{ secrets.GITHUB_TOKEN }}
56-
file: build/androidqf_darwin_amd64
57-
asset_name: androidqf_$tag_darwin_amd64
58-
tag: ${{ github.ref }}
59-
overwrite: true
56+
- name: Upload Darwin binary
57+
uses: svenstaro/upload-release-action@v2
58+
with:
59+
repo_token: ${{ secrets.GITHUB_TOKEN }}
60+
file: build/androidqf_darwin_amd64
61+
asset_name: androidqf_$tag_darwin_amd64
62+
tag: ${{ github.ref }}
63+
overwrite: true
6064

61-
- name: Upload Darwin arm64 binary
62-
uses: svenstaro/upload-release-action@v2
63-
with:
64-
repo_token: ${{ secrets.GITHUB_TOKEN }}
65-
file: build/androidqf_darwin_arm64
66-
asset_name: androidqf_$tag_darwin_arm64
67-
tag: ${{ github.ref }}
68-
overwrite: true
65+
- name: Upload Darwin arm64 binary
66+
uses: svenstaro/upload-release-action@v2
67+
with:
68+
repo_token: ${{ secrets.GITHUB_TOKEN }}
69+
file: build/androidqf_darwin_arm64
70+
asset_name: androidqf_$tag_darwin_arm64
71+
tag: ${{ github.ref }}
72+
overwrite: true

.github/workflows/staticcheck.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ jobs:
66
name: "Run CI"
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
with:
11-
fetch-depth: 1
12-
- name: download assets
13-
run: make download
14-
- name: build collector
15-
run: make collector
16-
- uses: dominikh/staticcheck-action@v1.3.0
17-
with:
18-
version: "2022.1.3"
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 1
12+
- uses: actions/setup-go@v5
13+
with:
14+
go-version: "1.22"
15+
cache: true
16+
- name: download assets
17+
run: make download
18+
- name: build collector
19+
run: make collector
20+
- uses: dominikh/staticcheck-action@v1.3.0
21+
with:
22+
version: "2023.1.6"

0 commit comments

Comments
 (0)