Skip to content

Commit

Permalink
goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Mar 24, 2024
1 parent a13fcf3 commit 2ea3632
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 140 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: '🧑‍🏭'
on: [ push ]
permissions:
contents: write
jobs:

check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- run: go vet ./...
- run: go test -v ./...

release:
if: startsWith(github.ref, 'refs/tags/v') == true
needs: check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- uses: goreleaser/goreleaser-action@v5
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 0 additions & 19 deletions .github/workflows/release.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/todos.yaml

This file was deleted.

18 changes: 1 addition & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
*
!*/

!/.github/**/*.yaml

!/.gitattributes
!/.gitignore

!/Makefile
!/deb.sh

!/go.mod
!/go.sum
!/*.go

!/LICENSE.txt
!/README.md
/dist/
80 changes: 80 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This is a goreleaser config file. Check the docs at https://goreleaser.com
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

project_name: gobonsai

builds:
- binary: '{{ .ProjectName }}'
env:
- CGO_ENABLED=0
tags:
- osusergo
- netgo
ldflags:
- '-s'
- '-w'
- '-X github.com/nothub/gobonsai/buildinfo.Version={{ .Version }}'
goos:
- linux
- darwin
- windows
ignore:
- goos: linux
goarch: 386
- goos: windows
goarch: 386
- goos: windows
goarch: arm64
#no_unique_dist_dir: true

upx:
- enabled: true
goos: [ linux, windows ]
compress: best
lzma: true

archives:
- meta: false
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
files:
- LICENSE.txt

nfpms:
- file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
maintainer: Florian Hübner <code@hub.lol>
description: |-
A bonsai tree generator
homepage: https://github.com/nothub/gobonsai
license: MIT
section: games
dependencies:
- libc6 (>= 2.24)
formats:
- apk
- deb
- rpm
- archlinux
bindir: /usr/local/bin
meta: false

changelog:
sort: asc

checksum:
name_template: "checksums.txt"
algorithm: sha256

release:
github:
owner: nothub
name: gobonsai
name_template: 'v{{ .Version }}'
header: 'Release generated at commit: {{ .ShortCommit }}'
draft: true
replace_existing_draft: true
32 changes: 0 additions & 32 deletions Makefile

This file was deleted.

5 changes: 2 additions & 3 deletions buildinfo.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package main

// This variable will be populated at build-time.
// TODO: version variable not injected at build
var version = ""
// The Version variable will be populated at build-time.
var Version = ""
41 changes: 0 additions & 41 deletions deb.sh

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module hub.lol/gobonsai
module github.com/nothub/gobonsai

go 1.20

Expand Down

0 comments on commit 2ea3632

Please sign in to comment.