From 93d4513c6f34a9068775244c74300463017fb213 Mon Sep 17 00:00:00 2001 From: "ritesh.noronha" Date: Mon, 14 Oct 2024 14:37:33 -0700 Subject: [PATCH] Update github actions --- .github/workflows/build.yml | 24 ++++++++++++------------ .github/workflows/ci.yml | 20 ++++++++++---------- .github/workflows/golangci-lint.yml | 14 +++++--------- .github/workflows/release.yml | 19 +++++++++---------- .github/workflows/sbom_dev.yml | 2 +- .github/workflows/sbom_release.yml | 2 +- 6 files changed, 38 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a3f6a5c..1fd1df6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,8 +5,8 @@ on: workflow_dispatch: env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: build-and-push-image: @@ -16,26 +16,26 @@ jobs: packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - name: GHCR login - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: - registry: '${{ env.REGISTRY }}' - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' + registry: "${{ env.REGISTRY }}" + username: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64, linux/arm64 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ee32c1a..09bf2cc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,16 +10,16 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '>=1.20' + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ">=1.20" - - name: Install dependencies - run: go mod download + - name: Install dependencies + run: go mod download - - name: Run tests - run: go test ./... -v + - name: Run tests + run: go test ./... -v diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index c6c4d0b9..6dd9a131 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,4 +1,3 @@ - name: golangci-lint on: @@ -12,7 +11,6 @@ on: permissions: contents: read - jobs: golangci: name: lint @@ -24,16 +22,14 @@ jobs: steps: - name: Checkout mode - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - + uses: actions/checkout@v4 + - name: Set up Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@v5 with: - go-version: '1.22' - check-latest: true + go-version: ">=1.20" - name: Run golangci-lint - uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1 + uses: golangci/golangci-lint-action@v6 with: - version: v1.59 args: --timeout=5m diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d49ce15..42674128 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release | Build Binary on: push: tags: - - 'v*' + - "v*" workflow_dispatch: jobs: @@ -13,26 +13,25 @@ jobs: id-token: write contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - run: git fetch --force --tags - - uses: actions/setup-go@v3 + - run: git fetch --force --tags + - uses: actions/setup-go@v5 with: - go-version: '>=1.20' - check-latest: true + go-version: ">=1.20" cache: true - name: Download syft binary run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin - name: Run syft run: syft version - name: Goreleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v6 with: - install-only: true + install-only: true - run: go version - - run: goreleaser -v + - run: goreleaser -v - name: Releaser - run: make release + run: make release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sbom_dev.yml b/.github/workflows/sbom_dev.yml index d2732555..4748f8b4 100644 --- a/.github/workflows/sbom_dev.yml +++ b/.github/workflows/sbom_dev.yml @@ -30,7 +30,7 @@ jobs: contents: write steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/sbom_release.yml b/.github/workflows/sbom_release.yml index 96ec23a9..9ef74568 100644 --- a/.github/workflows/sbom_release.yml +++ b/.github/workflows/sbom_release.yml @@ -26,7 +26,7 @@ jobs: contents: write steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0