Skip to content

Support custom labels #51

Support custom labels

Support custom labels #51

Workflow file for this run

name: CI
env:
# renovate: github=golangci/golangci-lint
GO_LINT_CI_VERSION: v1.59.0
on:
workflow_dispatch:
pull_request:
push:
tags:
- 'v*'
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
name: Build & Test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go build
- run: go test ./... -timeout 20s -race -covermode=atomic -coverprofile=coverage.out
- run: go test ./... -timeout 20s -bench . -benchmem -count 3
- name: go build (with goreleaser)
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --snapshot
env:
GITHUB_TOKEN: ""
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: dists
path: dist/
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GO_LINT_CI_VERSION }}
publish:
name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs:
- build
- lint
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}