Bump golangci/golangci-lint-action from 6.5.2 to 8.0.0 #721
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: ci/cd | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version: 1.24.x | |
- uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version: 1.24.x | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
with: | |
path: ~/go/pkg/mod | |
key: go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
go- | |
- run: make test | |
build-and-push-alpha: | |
if: startsWith(github.head_ref, 'bump-version-') | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
with: | |
fetch-depth: 0 | |
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0 | |
with: | |
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }} | |
role-session-name: "mackerel-container-agent-${{ github.run_id }}-${{ github.run_number }}" | |
aws-region: ap-northeast-1 | |
- name: Login to Public ECR | |
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
with: | |
registry: public.ecr.aws | |
env: | |
AWS_REGION: us-east-1 | |
- name: Login to GHCR | |
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get alpha version from branch name | |
id: get_alpha_version | |
run: echo "::set-output name=VERSION::${GITHUB_HEAD_REF/bump-version-/v}" | |
- name: Build and push alpha image | |
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
with: | |
context: . | |
file: Dockerfile | |
target: container-agent | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
push: true | |
tags: | | |
mackerel/mackerel-container-agent:${{ steps.get_alpha_version.outputs.VERSION }}-alpha | |
public.ecr.aws/mackerel/mackerel-container-agent:${{ steps.get_alpha_version.outputs.VERSION }}-alpha | |
ghcr.io/${{ github.repository_owner }}/mackerel-container-agent:${{ steps.get_alpha_version.outputs.VERSION }}-alpha | |
- name: Build and push alpha image with plugins | |
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
with: | |
context: . | |
file: Dockerfile | |
target: container-agent-with-plugins | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
push: true | |
tags: | | |
mackerel/mackerel-container-agent:${{ steps.get_alpha_version.outputs.VERSION }}-plugins-alpha | |
public.ecr.aws/mackerel/mackerel-container-agent:${{ steps.get_alpha_version.outputs.VERSION }}-plugins-alpha | |
ghcr.io/${{ github.repository_owner }}/mackerel-container-agent:${{ steps.get_alpha_version.outputs.VERSION }}-plugins-alpha | |
build-and-push-release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
with: | |
fetch-depth: 0 | |
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0 | |
with: | |
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }} | |
role-session-name: "mackerel-container-agent-${{ github.run_id }}-${{ github.run_number }}" | |
aws-region: ap-northeast-1 | |
- name: Login to Public ECR | |
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
with: | |
registry: public.ecr.aws | |
env: | |
AWS_REGION: us-east-1 | |
- name: Login to GHCR | |
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get version from tag | |
id: get_version | |
run: echo "::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}" | |
- name: Build and push release image | |
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
with: | |
context: . | |
file: Dockerfile | |
target: container-agent | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
push: true | |
tags: | | |
mackerel/mackerel-container-agent:latest | |
mackerel/mackerel-container-agent:${{ steps.get_version.outputs.VERSION }} | |
public.ecr.aws/mackerel/mackerel-container-agent:latest | |
public.ecr.aws/mackerel/mackerel-container-agent:${{ steps.get_version.outputs.VERSION }} | |
ghcr.io/${{ github.repository_owner }}/mackerel-container-agent:latest | |
ghcr.io/${{ github.repository_owner }}/mackerel-container-agent:${{ steps.get_version.outputs.VERSION }} | |
- name: Build and push release image with plugins | |
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
with: | |
context: . | |
file: Dockerfile | |
target: container-agent-with-plugins | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
push: true | |
tags: | | |
mackerel/mackerel-container-agent:plugins | |
mackerel/mackerel-container-agent:${{ steps.get_version.outputs.VERSION }}-plugins | |
public.ecr.aws/mackerel/mackerel-container-agent:plugins | |
public.ecr.aws/mackerel/mackerel-container-agent:${{ steps.get_version.outputs.VERSION }}-plugins | |
ghcr.io/${{ github.repository_owner }}/mackerel-container-agent:plugins | |
ghcr.io/${{ github.repository_owner }}/mackerel-container-agent:${{ steps.get_version.outputs.VERSION }}-plugins |