Added go releaser

This commit is contained in:
Arran Ubels 2023-02-15 16:06:01 +11:00
parent eabb56b497
commit c5b562ac1a
No known key found for this signature in database
GPG Key ID: 135EDC7B21D17F48
2 changed files with 77 additions and 0 deletions

39
.github/workflows/releaser.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: releaser
on:
push:
tags:
- 'v*.*.*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Cache-Go
uses: actions/cache@v1
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Test
run: go test ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

38
.goreleaser.yml Normal file
View File

@ -0,0 +1,38 @@
project_name: dateparse
builds:
-
id: "dateparse"
binary: "dateparse"
dir: dateparse
-
id: "example"
binary: "example"
dir: example
archives:
-
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
nfpms:
-
vendor: dateparse
homepage: https://github.com/araddon/dateparse
maintainer: n/a <someone@eample.com>
description: NA
formats:
- apk
- deb
- rpm
release: 1
section: default
priority: extra