1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

Update GitHub Workflows actions version (#1958)

* Update CI workflow actions version

* Update lint workflow actions version

* Update release workflow actions version

* Update Docker build workflow actions version

* disable lint cache to prevent bugs

* Update golinter action to latest

* Update Go to 1.20 in CI workflow
This commit is contained in:
Johnny Hsieh 2023-03-07 23:53:12 +08:00 committed by GitHub
parent a704009484
commit 414f067431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 23 deletions

View File

@ -20,10 +20,10 @@ jobs:
contents: read contents: read
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set time zone - name: Set time zone
uses: szenius/set-timezone@v1.0 uses: szenius/set-timezone@v1.1
with: with:
timezoneLinux: "Asia/Shanghai" timezoneLinux: "Asia/Shanghai"
timezoneMacos: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai"
@ -37,7 +37,7 @@ jobs:
# password: ${{ secrets.DOCKERHUB_TOKEN }} # password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR - name: Login to GHCR
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
@ -45,7 +45,7 @@ jobs:
- name: Extract metadata (tags, labels) for Docker - name: Extract metadata (tags, labels) for Docker
id: meta id: meta
uses: docker/metadata-action@v3 uses: docker/metadata-action@v4
with: with:
images: | images: |
ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}
@ -61,14 +61,14 @@ jobs:
type=semver,pattern={{major}} type=semver,pattern={{major}}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v4
with: with:
context: . context: .
push: true push: true

View File

@ -24,18 +24,12 @@ jobs:
goarch: "386" goarch: "386"
fail-fast: true fail-fast: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Setup Go environment - name: Setup Go environment
uses: actions/setup-go@v2.1.3 uses: actions/setup-go@v3
with: with:
cache: true
go-version: '1.20' go-version: '1.20'
- name: Cache downloaded module
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
- name: Build binary file - name: Build binary file
env: env:
GOOS: ${{ matrix.goos }} GOOS: ${{ matrix.goos }}
@ -49,7 +43,7 @@ jobs:
export LD_FLAGS="-w -s -X github.com/Mrs4s/go-cqhttp/internal/base.Version=${COMMIT_ID::7}" export LD_FLAGS="-w -s -X github.com/Mrs4s/go-cqhttp/internal/base.Version=${COMMIT_ID::7}"
go build -o "output/$BINARY_NAME" -trimpath -ldflags "$LD_FLAGS" . go build -o "output/$BINARY_NAME" -trimpath -ldflags "$LD_FLAGS" .
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
if: ${{ !github.head_ref }} if: ${{ !github.head_ref }}
with: with:
name: ${{ matrix.goos }}_${{ matrix.goarch }} name: ${{ matrix.goos }}_${{ matrix.goarch }}

View File

@ -7,15 +7,15 @@ jobs:
name: lint name: lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Setup Go environment - name: Setup Go environment
uses: actions/setup-go@v2.1.3 uses: actions/setup-go@v3
with: with:
go-version: '1.20' go-version: '1.20'
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v2 uses: golangci/golangci-lint-action@v3
with: with:
version: latest version: latest

View File

@ -10,17 +10,17 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.3.4 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: '1.20' go-version: '1.20'
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2 uses: goreleaser/goreleaser-action@v4
with: with:
version: latest version: latest
args: release --rm-dist args: release --rm-dist