From 1f0fc09be8bc2d98deaf2bfa618a98396b98afc0 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 6 Dec 2023 10:14:20 +0800 Subject: [PATCH] chore: update workflow actions and versions - Fix a typo in the cron expression for the codeql.yml workflow - Update the language specification for the codeql.yml workflow to use double quotes instead of single quotes - Update the version of the actions/checkout action in the codeql.yml workflow from v3 to v4 - Update the version of the actions/setup-go action in the docker.yml workflow from v4 to v3 - Update the version of the docker/setup-qemu-action action in the docker.yml workflow from v2 to v3 - Update the version of the docker/setup-buildx-action action in the docker.yml workflow from v2 to v3 - Update the version of the docker/login-action action in the docker.yml workflow from v2 to v3 - Update the version of the docker/metadata-action action in the docker.yml workflow from v4 to v5 - Update the version of the docker/build-push-action action in the docker.yml workflow from v4 to v5 - Remove the linux/arm platform from the docker.yml workflow - Update the version of the actions/checkout action in the goreleaser.yml workflow from v3 to v4 - Update the version of the actions/setup-go action in the goreleaser.yml workflow from v3 to v4 - Update the version of the goreleaser/goreleaser-action action in the goreleaser.yml workflow from v4 to v5 - Update the version of the actions/checkout action in the lint.yml workflow Signed-off-by: Bo-Yi Wu --- .github/workflows/codeql.yml | 34 +++++++++++------------ .github/workflows/docker.yml | 47 +++++++++++--------------------- .github/workflows/goreleaser.yml | 17 +++++------- .github/workflows/lint.yml | 8 +++--- 4 files changed, 44 insertions(+), 62 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2d9bcdd..3b324f1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,12 +13,12 @@ name: "CodeQL" on: push: - branches: [ master ] + branches: [master] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [master] schedule: - - cron: '41 23 * * 6' + - cron: "41 23 * * 6" jobs: analyze: @@ -32,23 +32,23 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'go' ] + language: ["go"] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index aef1471..7108fe1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,56 +5,42 @@ on: branches: - master tags: - - 'v*' + - "v*" pull_request: branches: - - 'master' + - "master" jobs: build-docker: runs-on: ubuntu-latest steps: - - name: Setup go - uses: actions/setup-go@v4 - with: - go-version: '^1' - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Build binary - run : | - make build_linux_amd64 - make build_linux_arm - make build_linux_arm64 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Docker meta + - name: Docker meta id: docker-meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ${{ github.repository }} @@ -65,12 +51,11 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - - - name: Build and push - uses: docker/build-push-action@v4 + - name: Build and push + uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64,linux/arm,linux/arm64 + platforms: linux/amd64,linux/arm64 file: docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker-meta.outputs.tags }} diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 565c382..ede4afa 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -3,7 +3,7 @@ name: Goreleaser on: push: tags: - - '*' + - "*" permissions: contents: write @@ -12,20 +12,17 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Setup go + - name: Setup go uses: actions/setup-go@v4 with: - go-version: '^1' + go-version: "^1" - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 with: # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fbd79fa..8e07864 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,9 +11,9 @@ jobs: - name: Setup go 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: @@ -30,9 +30,9 @@ jobs: container: golang:1.20-alpine steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: setup sshd server + - name: install packages run: | apk add make