feat(ci): Adds some CI
All checks were successful
build / build (push) Successful in 2m18s
Build and release / build (push) Successful in 11m48s

This commit is contained in:
Thomas Maurice 2024-02-12 17:32:52 +01:00
parent 86df61986e
commit dbe6120da6
Signed by: thomas
GPG key ID: 1D577F50583032A6
5 changed files with 149 additions and 0 deletions

View file

@ -0,0 +1,18 @@
name: build
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22
cache: true
- run: go mod tidy
- run: go test -v ./...
- run: go build

View file

@ -0,0 +1,28 @@
name: Build and release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22
cache: true
- run: go mod tidy
- run: go test -v ./...
- run: git reset --hard
- uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GORELEASER_FORCE_TOKEN: gitea
GITEA_TOKEN: ${{ secrets.TOKEN }}

View file

@ -0,0 +1,20 @@
name: build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22
cache: true
- run: go mod tidy
- run: go test -v ./...
- run: go build