Skip to content

Commit

Permalink
update and unified goreleaser setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Jun 12, 2024
1 parent 9017e95 commit c6f79e7
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 106 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/go.yml → .github/workflows/gorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@
name: GoReleaser

on:
pull_request:
push:
tags:
- "*"
- "*" # run on new tags

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout # required for the changelog to work correctly
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git fetch
run: git fetch --force --tags

- name: Setup Go with cache
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '>=1.19.5'
go-version: ">=1.22.3"
cache: true
- name: GoReleaser run
uses: goreleaser/goreleaser-action@v4

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions docs/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
### Backend

- [ ] *? Implememnt a [scheduling library for Go](https://github.com/reugn/go-quartz)
- [ ] [xstrings](https://github.com/huandu/xstrings) for string manipulation.
83 changes: 0 additions & 83 deletions init/.goreleaser-release.yaml

This file was deleted.

53 changes: 42 additions & 11 deletions init/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# .goreleaser-release.yaml
#
# The GoReleaser configuration for rgw Defacto2 server.
#
# This goreleaser file is intended for the included docker-compose.yml file
# to generate a release build of the server for Linux.
# The GoReleaser configuration for the Defacto2 server.
# GoReleaser is a release automation tool for Go projects and this file is
# is intended for use with a GitHub Actions workflow to generate a release build
# when a new tag is created.
#
# The configuration documentation is at https://goreleaser.com.
#
Expand All @@ -15,32 +15,63 @@
project_name: df2-server
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- id: server
main: server.go
env:
- CGO_ENABLED=0
targets:
# keep the number of targets to a minimum to improve the build time.
- linux_amd64
archives:
- format: zip
- format: zip # create a zip archive for simplicity
name_template: >-
{{ tolower .ProjectName }}_{{ .Version }}_{{- tolower .Os }}
{{ tolower .ProjectName }}_{{- tolower .Os }}
files:
- src: public/text/defacto2.txt
strip_parent: true
dst: defacto2.txt
info:
mtime: "{{ .CommitDate }}"
mode: 0644 # rw-r--r--
- src: init/defacto2.service
dst: defacto2.service
info:
mtime: "{{ .CommitDate }}"
mode: 0644 # rw-r--r--
- src: init/example.env.local
dst: example.env
info:
mtime: "{{ .CommitDate }}"
mode: 0644 # rw-r--r--
nfpms:
- id: deb # create a .deb package for use with dpkg
builds: ["server"]
package_name: df2-server
file_name_template: "{{ .ConventionalFileName }}"
vendor: Defacto2
homepage: https://github.com/Defacto2/server
maintainer: Ben Garrett <[email protected]>
description: |-
Defacto2 web server installer package.
license: GPL-3.0
formats:
- deb
dependencies:
- git
recommends:
- caddy
- postgresql
checksum:
name_template: "checksums.txt"
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
signs:
- artifacts: checksum
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^tmp:"
- ".env.local"
- ".env"

0 comments on commit c6f79e7

Please sign in to comment.