Skip to content

Merge pull request #1 from cernops/feat/config_section #3

Merge pull request #1 from cernops/feat/config_section

Merge pull request #1 from cernops/feat/config_section #3

Workflow file for this run

---
name: CI
on:
push:
tags:
- 'v*'
branches:
- 'main'
- 'master'
pull_request:
env:
# renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver-coerced
GOLANGCI_LINT_VERSION: "v2.6.2"
# renovate: datasource=github-releases depName=goreleaser/goreleaser versioning=semver-coerced
GORELEASER_VERSION: "v2.12.7"
# renovate: datasource=github-releases depName=ko-build/ko versioning=semver-coerced
KO_VERSION: "v0.18.0"
jobs:
go:
name: Go
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
go-version-file: 'go.mod'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47 # v9
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
- name: Run tests
run: go test -v ./...
- name: Build (Snapshot)
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
version: ${{ env.GORELEASER_VERSION }}
args: --clean --skip=ko,publish --snapshot
- name: Upload Artifacts (Snapshot)
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: dist
path: dist/*
- name: Set up ko
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
if: startsWith(github.ref, 'refs/tags/')
with:
version: ${{ env.KO_VERSION }}
- name: Release
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
if: startsWith(github.ref, 'refs/tags/')
with:
version: ${{ env.GORELEASER_VERSION }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}