Skip to content

Commit

Permalink
chore: update workflow actions and versions
Browse files Browse the repository at this point in the history
- 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 <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Dec 6, 2023
1 parent d372baf commit 1f0fc09
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 62 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
47 changes: 16 additions & 31 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Goreleaser
on:
push:
tags:
- '*'
- "*"

permissions:
contents: write
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 1f0fc09

Please sign in to comment.