Skip to content

Commit

Permalink
Merge pull request #30 from spwoodcock/ci/build-binaries
Browse files Browse the repository at this point in the history
Add config to generate binaries for the `build` cmd line tool
  • Loading branch information
iandees authored Nov 16, 2024
2 parents f75e845 + 1fcfbc0 commit fd9e5ed
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 0 deletions.
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:
push:
tags:
- '*'

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:'

0 comments on commit fd9e5ed

Please sign in to comment.