Skip to content

Commit

Permalink
ci: update GitHub Actions and streamline Go config
Browse files Browse the repository at this point in the history
- Update CodeQL GitHub Action from v2 to v3 in codeql.yml
- Update checkout GitHub Action from v3 to v4 in goreleaser.yml
- Add comment to fetch-depth parameter in goreleaser.yml
- Replace go-version with go-version-file and add check-latest in goreleaser.yml
- Change goreleaser args from `--rm-dist` to `--clear`
- Add checkout step with fetch-depth comment in testing.yml
- Remove specific go-version and replace with go-version-file and check-latest in testing.yml
- Update golangci-lint GitHub Action from v3 to v4 in testing.yml

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Mar 19, 2024
1 parent 940a4ed commit 39f76b0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -51,4 +51,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
10 changes: 6 additions & 4 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0 # all history for all branches and tags

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1"
go-version-file: go.mod
check-latest: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clear
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 12 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1.21"
- name: Checkout repository
uses: actions/checkout@v3
go-version-file: go.mod
check-latest: true
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --verbose
Expand All @@ -24,8 +28,10 @@ jobs:
runs-on: ubuntu-latest
container: golang:1.21-alpine
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags

- name: setup sshd server
run: |
Expand Down

0 comments on commit 39f76b0

Please sign in to comment.