Skip to content

Commit 7a07f0e

Browse files
committedFeb 18, 2024··
ci: update CI/CD workflows and dependencies
- Update cron syntax to use double quotes in codeql.yaml - Update CodeQL action versions from v1 to v3 in codeql.yaml - Replace setup-go action with checkout action and update versions in go.yml - Add fetch-depth configuration to checkout action in go.yml - Change setup-go action to use go.mod file for version and enable check-latest in go.yml - Update golangci-lint action version to v4 and set version to latest in go.yml - Update supported Go versions to 1.18 through 1.22 in go.yml - Update cache action version to v4 in go.yml - Update codecov action version to v4 in go.yml - Update checkout and setup-go action versions in goreleaser.yml - Change goreleaser-action version from v2 to v5 and update args in goreleaser.yml - Enable skipping the build by default in .goreleaser.yaml - Update section titles to use double quotes in .goreleaser.yaml - Change regex patterns to use double quotes in .goreleaser.yaml Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 1a98052 commit 7a07f0e

File tree

4 files changed

+38
-37
lines changed

4 files changed

+38
-37
lines changed
 

‎.github/workflows/codeql.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ name: "CodeQL"
77

88
on:
99
push:
10-
branches: [ main ]
10+
branches: [main]
1111
pull_request:
1212
# The branches below must be a subset of the branches above
13-
branches: [ main ]
13+
branches: [main]
1414
schedule:
15-
- cron: '30 1 * * 0'
15+
- cron: "30 1 * * 0"
1616

1717
jobs:
1818
analyze:
@@ -33,15 +33,15 @@ jobs:
3333
# Override automatic language detection by changing the below list
3434
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
3535
# TODO: Enable for javascript later
36-
language: [ 'go']
36+
language: ["go"]
3737

3838
steps:
3939
- name: Checkout repository
4040
uses: actions/checkout@v3
4141

4242
# Initializes the CodeQL tools for scanning.
4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@v1
44+
uses: github/codeql-action/init@v3
4545
with:
4646
languages: ${{ matrix.language }}
4747
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,4 +50,4 @@ jobs:
5050
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5151

5252
- name: Perform CodeQL Analysis
53-
uses: github/codeql-action/analyze@v1
53+
uses: github/codeql-action/analyze@v3

‎.github/workflows/go.yml

+15-12
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,25 @@ jobs:
1212
lint:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Setup go
16-
uses: actions/setup-go@v2
15+
- name: Checkout
16+
uses: actions/checkout@v4
1717
with:
18-
go-version: '^1'
19-
- name: Checkout repository
20-
uses: actions/checkout@v3
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: "go.mod"
23+
check-latest: true
2124
- name: Setup golangci-lint
22-
uses: golangci/golangci-lint-action@v2
25+
uses: golangci/golangci-lint-action@v4
2326
with:
24-
version: v1.45.0
27+
version: latest
2528
args: --verbose
2629
test:
2730
strategy:
2831
matrix:
2932
os: [ubuntu-latest]
30-
go: [1.13, 1.14, 1.15, 1.16, 1.17, 1.18]
33+
go: [1.18, 1.19, "1.20", 1.21, 1.22]
3134
include:
3235
- os: ubuntu-latest
3336
go-build: ~/.cache/go-build
@@ -38,16 +41,16 @@ jobs:
3841
GOPROXY: https://proxy.golang.org
3942
steps:
4043
- name: Set up Go ${{ matrix.go }}
41-
uses: actions/setup-go@v2
44+
uses: actions/setup-go@v5
4245
with:
4346
go-version: ${{ matrix.go }}
4447

4548
- name: Checkout Code
46-
uses: actions/checkout@v3
49+
uses: actions/checkout@v4
4750
with:
4851
ref: ${{ github.ref }}
4952

50-
- uses: actions/cache@v2
53+
- uses: actions/cache@v4
5154
with:
5255
path: |
5356
${{ matrix.go-build }}
@@ -60,6 +63,6 @@ jobs:
6063
go test -v -covermode=atomic -coverprofile=coverage.out ./...
6164
6265
- name: Upload coverage to Codecov
63-
uses: codecov/codecov-action@v2
66+
uses: codecov/codecov-action@v4
6467
with:
6568
flags: ${{ matrix.os }},go-${{ matrix.go }}

‎.github/workflows/goreleaser.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Goreleaser
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
permissions:
99
contents: write
@@ -12,23 +12,21 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
-
16-
name: Checkout
17-
uses: actions/checkout@v2
15+
- name: Checkout
16+
uses: actions/checkout@v4
1817
with:
1918
fetch-depth: 0
20-
-
21-
name: Set up Go
22-
uses: actions/setup-go@v2
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
2321
with:
24-
go-version: 1.17
25-
-
26-
name: Run GoReleaser
27-
uses: goreleaser/goreleaser-action@v2
22+
go-version-file: "go.mod"
23+
check-latest: true
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v5
2826
with:
2927
# either 'goreleaser' (default) or 'goreleaser-pro'
3028
distribution: goreleaser
3129
version: latest
32-
args: release --rm-dist
30+
args: release --clean
3331
env:
3432
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.goreleaser.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
project_name: queue
22

33
builds:
4-
-
5-
# If true, skip the build.
4+
- # If true, skip the build.
65
# Useful for library projects.
76
# Default is false
87
skip: true
98

109
changelog:
1110
# Set it to true if you wish to skip the changelog generation.
1211
# This may result in an empty release notes on GitHub/GitLab/Gitea.
13-
skip: false
12+
# Default is false
13+
skip: true
1414

1515
# Changelog generation implementation to use.
1616
#
@@ -38,10 +38,10 @@ changelog:
3838
- title: Features
3939
regexp: "^.*feat[(\\w)]*:+.*$"
4040
order: 0
41-
- title: 'Bug fixes'
41+
- title: "Bug fixes"
4242
regexp: "^.*fix[(\\w)]*:+.*$"
4343
order: 1
44-
- title: 'Enhancements'
44+
- title: "Enhancements"
4545
regexp: "^.*chore[(\\w)]*:+.*$"
4646
order: 2
4747
- title: Others
@@ -52,6 +52,6 @@ changelog:
5252
# the changelog
5353
# Default is empty
5454
exclude:
55-
- '^docs'
56-
- 'CICD'
55+
- "^docs"
56+
- "CICD"
5757
- typo

0 commit comments

Comments
 (0)
Please sign in to comment.