Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config to generate binaries for the build cmd line tool #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: goreleaser

on:
pull_request:
push:

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v5
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128 changes: 128 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
version: 2

env:
- CGO_ENABLED=1

builds:
# MacOS AMD64
- id: tilepack-darwin-amd64
binary: tilepack
main: cmd/build/main.go
goarch:
- amd64
goos:
- darwin
env:
- CC=o64-clang
- CXX=o64-clang++
flags:
- -trimpath

# MacOS ARM64
- id: tilepack-darwin-arm64
binary: tilepack
main: cmd/build/main.go
goarch:
- arm64
goos:
- darwin
env:
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- -trimpath

# Linux AMD64
- id: tilepack-linux-amd64
binary: tilepack
main: cmd/build/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"

# Linux ARM64
- id: tilepack-linux-arm64
binary: tilepack
main: cmd/build/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"

# Windows AMD64
- id: tilepack-windows-amd64
binary: tilepack
main: cmd/build/main.go
goarch:
- amd64
goos:
- windows
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
flags:
- -trimpath
- -buildmode=exe

# Windows ARM64
- id: tilepack-windows-arm64
binary: tilepack
main: cmd/build/main.go
goarch:
- arm64
goos:
- windows
env:
- CC=/llvm-mingw/bin/aarch64-w64-mingw32-gcc
- CXX=/llvm-mingw/bin/aarch64-w64-mingw32-g++
flags:
- -trimpath
- -buildmode=exe

archives:
- name_template: "tilepack_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
builds:
- tilepack-darwin-amd64
- tilepack-darwin-arm64
- tilepack-linux-amd64
- tilepack-linux-arm64
- tilepack-windows-amd64
- tilepack-windows-arm64
wrap_in_directory: false
format: tar.gz
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
files:
- none*

checksum:
name_template: 'checksums.txt'
gitlab_urls:
use_package_registry: true
snapshot:
version_template: '{{ .Tag }}-next'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^.github:'
- '^vendor:'