nurse/.forgejo/workflows/go.yaml
Forgejo Actions 630708c977
Some checks failed
Go build / build (push) Has been cancelled
chore(deps): update actions/setup-go action to v5
2023-12-10 03:34:15 +00:00

64 lines
1.6 KiB
YAML

name: Go build
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
lfs: 'true'
fetch-tags: 'true'
- name: Setup Go 1.21.x
uses: actions/setup-go@v5
with:
# Semantic version range syntax or exact version of Go
go-version: '1.21.x'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
- name: Install Task
uses: arduino/setup-task@v1
- name: Run tests
run: |
go install gotest.tools/gotestsum@latest
gotestsum --junitfile out/results.xml --format pkgname-and-test-fails -- -race -shuffle=on ./...
- name: Snapshot release
uses: goreleaser/goreleaser-action@v5
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
- name: Login to Docker registry
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: docker/login-action@v3
with:
registry: code.icb4dc0.de
username: ${{ github.repository_owner }}
password: ${{ secrets.RELEASE_TOKEN }}
- name: Release
uses: goreleaser/goreleaser-action@v5
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ""
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}