From ec8196ddc9e4b40bcfaf04f0f7e75abf44b92a8c Mon Sep 17 00:00:00 2001 From: mdouchement Date: Thu, 9 May 2024 23:12:02 +0200 Subject: [PATCH] Update GH actions --- .github/workflows/codeql-analysis.yml | 14 +++++++------- .github/workflows/docker.yml | 10 +++++----- .github/workflows/golangci-lint.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- Dockerfile | 12 ++---------- go.mod | 2 +- 7 files changed, 22 insertions(+), 30 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d445510..ab76d74 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,30 +38,30 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # 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. # 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. - + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - # If the Autobuild fails above, remove it and uncomment the following three lines. + # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. # - run: | @@ -69,4 +69,4 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b2901c..36d5361 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all history for all branches and tags # @@ -51,20 +51,20 @@ jobs: echo ::set-output name=tags::${TAGS} # - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 # - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 # - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} # - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: file: Dockerfile context: . diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 37caace..ff7e9e7 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,13 +14,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} check-latest: true - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: version: latest \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3f1283..f226c35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: steps: # - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} check-latest: true @@ -29,7 +29,7 @@ jobs: cp task /usr/local/bin/ # - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # - name: Build binaries run: task build-all diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index efb5e13..eccc9d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,13 +11,13 @@ jobs: steps: # - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} check-latest: true - name: Tooling run: go install gotest.tools/gotestsum@latest - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Test run: gotestsum diff --git a/Dockerfile b/Dockerfile index 2dcdbb1..0326e79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,15 +3,7 @@ FROM golang:alpine as build-env MAINTAINER mdouchement RUN apk upgrade -RUN apk add --update --no-cache git curl - -ARG TASK_VERSION=v3.11.0 -ARG TASK_SUM=8284fa89367e0bbb8ba5dcb90baa6826b7669c4a317e5b9a46711f7380075e21 - -RUN curl -LO https://github.com/go-task/task/releases/download/$TASK_VERSION/task_linux_amd64.tar.gz && \ - echo "$TASK_SUM task_linux_amd64.tar.gz" | sha256sum -c && \ - tar -xf task_linux_amd64.tar.gz && \ - cp task /usr/local/bin/ +RUN apk add --update --no-cache git curl go-task RUN mkdir -p /go/src/github.com/mdouchement/standardfile WORKDIR /go/src/github.com/mdouchement/standardfile @@ -24,7 +16,7 @@ COPY . /go/src/github.com/mdouchement/standardfile # Dependencies RUN go mod download -RUN task build-server +RUN go-task build-server # final stage FROM alpine diff --git a/go.mod b/go.mod index 62673bc..81d0cf6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mdouchement/standardfile -go 1.22 +go 1.21 require ( github.com/appleboy/gofight/v2 v2.1.2