Skip to content

Commit

Permalink
Merge pull request #25 from port-labs/PORT-5363-added-darwin-build
Browse files Browse the repository at this point in the history
go releaser
  • Loading branch information
yairsimantov20 authored Dec 27, 2023
2 parents 1c582df + cb9f192 commit 78d945c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:

env:
REGISTRY: "ghcr.io"
Expand Down Expand Up @@ -42,11 +43,16 @@ jobs:
go-version: 1.19
cache: true

- name: OSXCross for CGO Support
run: |
mkdir ../../osxcross
git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
args: release --rm-dist --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
Expand Down
14 changes: 12 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@ before:
hooks:
- go mod tidy
builds:
- env:
- id: linux-build
env:
- CGO_ENABLED=1
binary: "{{ .ProjectName }}"
goos:
- linux
goarch:
- amd64
- arm64
- id: darwin-build
env:
- CGO_ENABLED=1
- CC=/home/runner/work/osxcross/target/bin/o64-clang
- CXX=/home/runner/work/osxcross/target/bin/o64-clang++
goos:
- darwin
ignore:
- goos: darwin
goarch: 386
dockers:
- image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Version }}-amd64"
Expand Down

0 comments on commit 78d945c

Please sign in to comment.