Skip to content

Commit

Permalink
Add Goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
sj14 committed Apr 28, 2024
1 parent fbe1380 commit edf419d
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Go
on:
push:
paths:
- go.mod
- go.sum
- "**.go"
- ".github/workflows/go.yaml"
jobs:
build:
name: Test
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Format
run: |
go fmt ./...
git diff --exit-code
- name: Vet
run: go vet ./...
- uses: dominikh/[email protected]
with:
install-go: false
- name: Test
run: go test -race ./...
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release
on:
push:
tags:
- "*"
jobs:
goreleaser:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
project_name: jellyctl

before:
hooks:
- go mod download
builds:
- main: ./main.go
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
archives:
- format: binary
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next-{{.Commit}}"
brews:
- name: jellyctl
skip_upload: auto
repository:
owner: sj14
name: homebrew-tap
description: "A CLI for managing your Jellyfin server"
release:
github:
owner: sj14
name: jellyctl
disable: false
draft: false
prerelease: auto
changelog:
filters:
exclude:
- typo

0 comments on commit edf419d

Please sign in to comment.