Skip to content

fix(cli/capture): remove global Logger, inject via dependency injection (issue #585) #5526

fix(cli/capture): remove global Logger, inject via dependency injection (issue #585)

fix(cli/capture): remove global Logger, inject via dependency injection (issue #585) #5526

Workflow file for this run

name: goreleaser
on:
pull_request:
branches: [main]
push:
tags: ["v*"]
permissions:
contents: write
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build kubectl-retina
if: github.ref_type == 'branch'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- name: Install Syft
uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0
- name: Run GoReleaser build
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
env:
MCR_AGENT_IMAGE_NAME: mcr.microsoft.com/containernetworking/retina-agent
with:
distribution: goreleaser
version: latest
args: build --snapshot --clean
release:
name: Release kubectl-retina
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.ref_type == 'tag'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- name: Install Syft
uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0
- name: Run GoReleaser release
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MCR_AGENT_IMAGE_NAME: mcr.microsoft.com/containernetworking/retina-agent
- name: Check if release tag
id: check-tag
run: |
if [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "is_release=true" >> $GITHUB_OUTPUT
else
echo "is_release=false" >> $GITHUB_OUTPUT
fi
- name: Update new version in krew-index
if: github.repository_owner == 'microsoft' && steps.check-tag.outputs.is_release == 'true'
uses: rajatjindal/krew-release-bot@c970b8a8f6dbc2f2285a26e3ae160903b87002c3 # v0.0.51