From 512db635151eadf767ca1670151d5d108be15d01 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 5 Dec 2023 10:14:23 +0800 Subject: [PATCH] chore: update GitHub Actions workflows for Go and CodeQL - Change the cron schedule from `'30 1 * * 0'` to `"30 1 * * 0"` in `.github/workflows/codeql.yaml` - Change the value of `language` from `['go']` to `["go"]` in `.github/workflows/codeql.yaml` - Update the `uses` value from `actions/checkout@v3` to `actions/checkout@v4` in `.github/workflows/codeql.yaml` - Update the `uses` value from `actions/setup-go@v3` to `actions/setup-go@v4` in `.github/workflows/go.yml` - Change the value of `go-version` from `'1'` to `"^1"` in `.github/workflows/go.yml` - Update the `uses` value from `actions/checkout@v3` to `actions/checkout@v4` in `.github/workflows/go.yml` - Add a new job in `.github/workflows/go.yml` - Change the value of `go` from `[1.17, 1.18, 1.19]` to `[1.18, 1.19, "1.20", 1.21]` in `.github/workflows/go.yml` - Update the `uses` value from `actions/setup-go@v3` to `actions/setup-go@v4` in `.github/workflows/go.yml` - Update the `uses` value from Signed-off-by: Bo-Yi Wu --- .github/workflows/codeql.yaml | 10 +++++----- .github/workflows/go.yml | 13 ++++++------- .github/workflows/goreleaser.yml | 19 ++++++++----------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index beb8101..c2a1a95 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -7,12 +7,12 @@ name: "CodeQL" on: push: - branches: [ main ] + branches: [main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main] schedule: - - cron: '30 1 * * 0' + - cron: "30 1 * * 0" jobs: analyze: @@ -33,11 +33,11 @@ jobs: # Override automatic language detection by changing the below list # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] # TODO: Enable for javascript later - language: [ 'go'] + language: ["go"] steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5ed1353..a873075 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,15 +6,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: '^1' + go-version: "^1" - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.50.1 args: --verbose # Label of the container job @@ -22,7 +21,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - go: [1.17, 1.18, 1.19] + go: [1.18, 1.19, "1.20", 1.21] include: - os: ubuntu-latest go-build: ~/.cache/go-build @@ -39,12 +38,12 @@ jobs: slave1-port: 6380 - name: Set up Go ${{ matrix.go }} - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 3af3a45..9d84286 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -3,7 +3,7 @@ name: Goreleaser on: push: tags: - - '*' + - "*" permissions: contents: write @@ -12,19 +12,16 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v3 + - name: Set up Go + uses: actions/setup-go@v4 with: - go-version: 1.17 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + go-version: "^1" + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 with: # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser