Skip to content

Commit

Permalink
wip trying crossplatform compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
aybabtme committed Oct 29, 2024
1 parent 29b2a6a commit faa2e66
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@ jobs:
create_a_dev_release:
name: create a dev release
runs-on: ubuntu-latest
container:
image: ghcr.io/goreleaser/goreleaser-cross:v1.23.2
env:
GOPRIVATE: "github.com/humanlogio/humanlog-pro"
GH_ACCESS_TOKEN_FOR_HUMANLOGPRO: ${{ secrets.GH_ACCESS_TOKEN_FOR_HUMANLOGPRO }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git config --global --add safe.directory '*'
- run: git config --global url.https://[email protected]/.insteadOf https://github.com/
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: ">=1.23"
cache: true
- run: git config --global url.https://[email protected]/.insteadOf https://github.com/
- run: echo "${HOME}/.humanlog/bin" >> $GITHUB_PATH
- run: curl https://humanlog.dev/install_apictl.sh | bash
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: v2
args: release --clean --draft --skip validate --config .goreleaser-dev.yaml
args: release --verbose --clean --draft --skip validate --config .goreleaser-dev.yaml
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_BINARIES_BUCKET_KEY_ID }}
Expand Down
100 changes: 97 additions & 3 deletions .goreleaser-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,114 @@ before:
- go generate ./...
- mkdir -p dist-extra
- script/write_version_info.sh "{{.Major}}" "{{.Minor}}" "{{.Patch}}" "next.{{ .CommitTimestamp }}" "{{.ShortCommit}}" "https://humanlog-binaries.sfo3.cdn.digitaloceanspaces.com/humanlog-binaries/{{ .ProjectName }}/dev/{{ .CommitTimestamp }}/{{ .ShortCommit }}"
# builds:
# - main: ./cmd/humanlog/
# binary: humanlog
# env:
# - CGO_ENABLED=1
# tags:
# - pro
# ldflags:
# - -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr=https://api.humanlog.dev -X main.defaultBaseSiteAddr=https://humanlog.dev
# goos:
# # - windows
# - darwin
# - linux
# goarch:
# - amd64
# - arm64

builds:
- main: ./cmd/humanlog/
- id: humanlog-darwin-amd64
binary: humanlog
main: ./cmd/humanlog
tags:
- pro
goarch:
- amd64
goos:
- darwin
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
flags:
- -trimpath
ldflags:
- -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr=https://api.humanlog.dev -X main.defaultBaseSiteAddr=https://humanlog.dev

- id: humanlog-darwin-arm64
binary: humanlog
main: ./cmd/humanlog
tags:
- pro
goarch:
- arm64
goos:
# - windows
- darwin
- linux
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- -trimpath
ldflags:
- -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr=https://api.humanlog.dev -X main.defaultBaseSiteAddr=https://humanlog.dev

- id: humanlog-linux-amd64
binary: humanlog
main: ./cmd/humanlog
tags:
- pro
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
goarch:
- amd64
goos:
- linux
flags:
- -trimpath
ldflags:
- -extldflags "-lc -lrt -lpthread --static" -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr=https://api.humanlog.dev -X main.defaultBaseSiteAddr=https://humanlog.dev

- id: humanlog-linux-arm64
binary: humanlog
main: ./cmd/humanlog
tags:
- pro
goarch:
- arm64
goos:
- linux
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
flags:
- -trimpath
ldflags:
- -extldflags "-lc -lrt -lpthread --static" -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr=https://api.humanlog.dev -X main.defaultBaseSiteAddr=https://humanlog.dev

# - id: humanlog-windows-amd64
# binary: humanlog
# main: ./cmd/humanlog
# tags:
# - pro
# goarch:
# - amd64
# goos:
# - windows
# env:
# - CC=x86_64-w64-mingw32-gcc
# - CXX=x86_64-w64-mingw32-g++
# flags:
# - -trimpath
# - -buildmode=exe
# ldflags:
# - -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr=https://api.humanlog.dev -X main.defaultBaseSiteAddr=https://humanlog.dev

release:
disable: true
blobs:
Expand Down

0 comments on commit faa2e66

Please sign in to comment.