Files
Izrafil Archimedes 6aeeb5c178
All checks were successful
CI / test (push) Successful in 10m33s
CI / lint (push) Successful in 19m52s
CI / build (push) Successful in 10m8s
CI / release (push) Successful in 13m46s
ci: remove hook goreleaser
2026-02-23 11:12:04 +01:00

108 lines
2.5 KiB
YAML

name: CI
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.10.1
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: Install gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run tests
run: |
set -euo pipefail
go test -json -race -covermode=atomic -coverprofile=coverage.out ./pkg/... 2>&1 | tee /tmp/gotest.log | gotestfmt
build:
runs-on: ubuntu-latest
permissions:
contents: read
needs:
- lint
- test
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: Build
run: make build
release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: build
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: Build and install provider-zexlab plugin
run: |
go build -o provider-zexlab ./cmd/provider-zexlab/
PLUGIN_DIR=".semrel/$(go env GOOS)_$(go env GOARCH)/provider-zexlab/0.0.0-dev"
mkdir -p "$PLUGIN_DIR"
mv provider-zexlab "$PLUGIN_DIR/provider-zexlab"
chmod +x "$PLUGIN_DIR/provider-zexlab"
- uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.ZX_TOKEN }}
allow-initial-development-versions: true
custom-arguments: "--provider zexlab"
env:
GITEA_TOKEN: ${{ secrets.ZX_TOKEN }}
- name: Fetch new tag
if: steps.semrel.outputs.version != ''
run: git fetch --tags origin
- name: Run GoReleaser
if: steps.semrel.outputs.version != ''
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean --skip=validate
env:
GITEA_TOKEN: ${{ secrets.ZX_TOKEN }}