Add Gitea Actions workflows.
All checks were successful
Build & Test / Main (push) Successful in 31s
Release / Release (push) Successful in 35s

This commit is contained in:
Sam Fredrickson 2023-12-10 02:19:04 -08:00
parent 0346b96449
commit 289468720e
4 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,38 @@
name: Build & Test
on:
push:
branches:
- "**"
jobs:
Main:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.5
-
name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
-
name: Run tests
run: go test ./...
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: 1.22.1
args: release --clean --snapshot
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GORELEASER_FORCE_TOKEN: gitea

View File

@ -0,0 +1,30 @@
name: Release
on:
push:
tags:
- v*
jobs:
Release:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: 1.22.1
args: release --clean
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GORELEASER_FORCE_TOKEN: gitea

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/datashake
/release
datashake.json
dist/

46
.goreleaser.yaml Normal file
View File

@ -0,0 +1,46 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 1
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
gitea_urls:
api: https://code.humancabbage.net/api/v1
download: http://code.humancabbage.net