Skip to content

chore: bump goreleaser/goreleaser-action from 4 to 5 #128

chore: bump goreleaser/goreleaser-action from 4 to 5

chore: bump goreleaser/goreleaser-action from 4 to 5 #128

Workflow file for this run

name: Continuous Integration Pipeline
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
- docs/**
- examples/**
env:
GO_VERSION: 1.19.5
GO_CACHE: true
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Set golangci-lint Cache Key
id: create-sha
run: |
echo "GOLANGCILINT_SHA=$(cat ./tools/GOLANGCI_LINT_VERSION | sha256sum - | awk '{ print $1 }')" >> $GITHUB_ENV
- name: Setup golangci-lint Cache
uses: actions/cache@v3
with:
path: |
./tools/bin
key: ${{ runner.os }}-go-${{ env.GOLANGCILINT_SHA }}
restore-keys: |
${{ runner.os }}-go-${{ env.GOLANGCILINT_SHA }}
- name: Run Lint CI
run: make ci-lint GOLANGCI_LINT_MODE="github-actions"
test:
name: Testing on ${{ matrix.os }} #and kubernetes ${{ matrix.k8s_version}}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
# k8s_version:
# - "1.22"
# - "1.23"
# - "1.24"
runs-on: ${{ matrix.os }}
# env:
# ENVTEST_K8S_VERSION: ${{matrix.k8s_version}}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run Test Coverage
run: make ci
build:
name: Build for Supported Architectures
runs-on: ubuntu-latest
needs:
- lint
- test
if: github.event_name != 'push'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run Build Multiarchitecture
run: make build-multiarch
publish-release:
runs-on: ubuntu-latest
needs:
- lint
- test
if: github.event_name == 'push'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Setup Goreleaser
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
- name: Set Snapshot Release Environment
if: github.ref_type == 'branch'
run: |
echo "SNAPSHOT_RELEASE=1" >> $GITHUB_ENV
- name: Run Goreleaser
run: make ci-release SNAPSHOT_RELEASE=${SNAPSHOT_RELEASE}
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Upload Binaries Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: bin/
publish-docker:
runs-on: ubuntu-latest
needs:
- publish-release
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Download Binaries
uses: actions/download-artifact@v3
with:
name: artifacts
path: bin/
- name: Restore Executable Permissions
run: |
find ./bin/{darwin,linux} -type f -exec chmod +x {} \;
- name: Docker Login to GitHub Repository
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.BOT_DOCKER_USERNAME }}
password: ${{ secrets.BOT_DOCKER_TOKEN }}
- name: Setup QEMU
run: make docker-setup-multiarch
- name: Setup Buildx Context
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build Latest Image
run: make ci-docker BUILDX_CONTEXT=${{ steps.buildx.outputs.name }}