Skip to content

Commit

Permalink
Merge pull request #38 from safesoftware/disable-cgo
Browse files Browse the repository at this point in the history
Make the binary more portable by disabling CGO when building.
  • Loading branch information
garnold54 authored Mar 6, 2023
2 parents 7d7f7fe + 3b221de commit 859893d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
export GOOS=${{ matrix.os }}
export GOARCH=${{ matrix.arch }}
go build -o fmeserver${{ matrix.exe-ext }} -ldflags="-X \"github.com/safesoftware/fmeserver-cli/cmd.appVersion=${{ env.APP_VERSION }}\""
CGO_ENABLED=0 go build -o fmeserver${{ matrix.exe-ext }} -ldflags="-X \"github.com/safesoftware/fmeserver-cli/cmd.appVersion=${{ env.APP_VERSION }}\""
- name: Upload artifact for later steps
uses: actions/upload-artifact@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ jobs:
with:
go-version: 1.19

- name: Test build
run: CGO_ENABLED=0 go build -o fmeserver -ldflags="-X \"github.com/safesoftware/fmeserver-cli/cmd.appVersion=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev )\""

- name: Run tests
run: go test ./...

0 comments on commit 859893d

Please sign in to comment.