wip: goreleaser

This commit is contained in:
Hayden 2023-03-22 09:03:19 -08:00
parent 840d220d4f
commit 0949422aa3
No known key found for this signature in database
GPG key ID: 17CF79474E257545
3 changed files with 128 additions and 1 deletions

View file

@ -13,3 +13,18 @@ jobs:
frontend-tests: frontend-tests:
name: "Frontend and End-to-End Tests" name: "Frontend and End-to-End Tests"
uses: ./.github/workflows/partial-frontend.yaml uses: ./.github/workflows/partial-frontend.yaml
releaser:
name: "Cross Compile and Release"
runs-on: ubuntu-latest
container:
image: goreleaser/goreleaser:v1.20
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Cross Compile and Release"
run: goreleaser releaser --snapshot --clean --skip-publish

3
.gitignore vendored
View file

@ -48,4 +48,5 @@ dist
.pnpm-store .pnpm-store
backend/app/api/app backend/app/api/app
backend/app/api/__debug_bin backend/app/api/__debug_bin
dist/

111
backend/.goreleaser.yaml Normal file
View file

@ -0,0 +1,111 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
env:
- CGO_ENABLED=1
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- id: homebox-darwin-amd64
binary: homebox
main: ./app/api/main.go
goarch:
- amd64
goos:
- darwin
env:
- CC=o64-clang
- CXX=o64-clang++
flags:
- -trimpath
- id: homebox-darwin-arm64
binary: homebox
main: ./app/api/main.go
goarch:
- arm64
goos:
- darwin
env:
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- -trimpath
- id: homebox-linux-amd64
binary: homebox
main: ./app/api/main.go
env:
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
goarch:
- amd64
goos:
- linux
flags:
- -trimpath
ldflags:
- -extldflags "-lc -lrt -lpthread --static"
- id: homebox-linux-arm64
binary: homebox
main: ./app/api/main.go
goarch:
- arm64
goos:
- linux
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
flags:
- -trimpath
ldflags:
- -extldflags "-lc -lrt -lpthread --static"
- id: homebox-windows-amd64
binary: homebox
main: ./app/api/main.go
goarch:
- amd64
goos:
- windows
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
flags:
- -trimpath
- -buildmode=exe
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
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj