Skip to content

Commit

Permalink
disable CGO in rpm/deb Centrifugo build (#645)
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia authored Apr 21, 2023
1 parent 24d7894 commit 47e4ffa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Install gox
run: go install github.com/mitchellh/gox@latest

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ DOCKER_RUN_DOC_OPTS := --rm $(DOCKER_RUN_DOC_MOUNT) -p $(DOCKER_RUN_DOC_PORT):80

all: test

prepare:
go install github.com/mitchellh/gox@latest

test:
go test -count=1 -v $(TESTFOLDERS) -cover -race

Expand Down
4 changes: 2 additions & 2 deletions misc/scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ do_build() {
echo "STATS_TOKEN found"
fi

gox -os="linux" -ldflags="-X github.com/centrifugal/centrifugo/v4/internal/build.Version=$VERSION -X github.com/centrifugal/centrifugo/v4/internal/build.UsageStatsEndpoint=$STATS_ENDPOINT -X github.com/centrifugal/centrifugo/v4/internal/build.UsageStatsToken=$STATS_TOKEN" -arch="amd64" -output="$TMP_BINARIES_DIR/{{.OS}}-{{.Arch}}/centrifugo"
CGO_ENABLED=0 GOOS="linux" GOARCH="amd64" go build -ldflags="-X github.com/centrifugal/centrifugo/v4/internal/build.Version=$VERSION -X github.com/centrifugal/centrifugo/v4/internal/build.UsageStatsEndpoint=$STATS_ENDPOINT -X github.com/centrifugal/centrifugo/v4/internal/build.UsageStatsToken=$STATS_TOKEN" -o "$TMP_BINARIES_DIR/centrifugo"
echo "Binary build completed successfully"
}

do_build $VERSION

make_dir_tree $TMP_WORK_DIR

cp $TMP_BINARIES_DIR/linux-amd64/centrifugo $TMP_WORK_DIR/$INSTALL_DIR/
cp $TMP_BINARIES_DIR/centrifugo $TMP_WORK_DIR/$INSTALL_DIR/
if [ $? -ne 0 ]; then
echo "Failed to copy binaries to packaging directory ($TMP_WORK_DIR/$INSTALL_DIR/) -- aborting."
cleanup_exit 1
Expand Down

0 comments on commit 47e4ffa

Please sign in to comment.