diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97e3d09..a97e904 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,7 +143,7 @@ jobs: - name: Install Windows cross-compilation tools run: | sudo apt-get update - sudo apt-get install -y gcc-mingw-w64-x86-64 + sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 - name: Build npm binaries with GoReleaser uses: goreleaser/goreleaser-action@v5 diff --git a/.github/workflows/test-npm-build.yml b/.github/workflows/test-npm-build.yml index 9f5bee8..cd9ed25 100644 --- a/.github/workflows/test-npm-build.yml +++ b/.github/workflows/test-npm-build.yml @@ -21,7 +21,7 @@ jobs: - name: Install Windows cross-compilation tools run: | sudo apt-get update - sudo apt-get install -y gcc-mingw-w64-x86-64 + sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 - name: Set up Node.js uses: actions/setup-node@v4 diff --git a/.goreleaser/npm.yml b/.goreleaser/npm.yml index 7215b06..954126c 100644 --- a/.goreleaser/npm.yml +++ b/.goreleaser/npm.yml @@ -14,7 +14,7 @@ builds: goos: [darwin] goarch: [amd64] env: - - CGO_ENABLED=1 + - CGO_ENABLED=0 ldflags: - -s -w -X github.com/hookdeck/hookdeck-cli/pkg/version.Version={{.Version}} hooks: @@ -28,6 +28,8 @@ builds: main: ./main.go goos: [darwin] goarch: [arm64] + env: + - CGO_ENABLED=0 ldflags: - -s -w -X github.com/hookdeck/hookdeck-cli/pkg/version.Version={{.Version}} hooks: @@ -91,8 +93,8 @@ builds: goarch: [386] env: - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc - - CXX=x86_64-w64-mingw32-g++ + - CC=i686-w64-mingw32-gcc + - CXX=i686-w64-mingw32-g++ ldflags: - -s -w -X github.com/hookdeck/hookdeck-cli/pkg/version.Version={{.Version}} hooks: diff --git a/bin/hookdeck.js b/bin/hookdeck.js index 5d0a978..69b9528 100755 --- a/bin/hookdeck.js +++ b/bin/hookdeck.js @@ -32,6 +32,6 @@ try { execFileSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' }); } catch (error) { // execFileSync will exit with the same code as the binary - // If there's an error executing, exit with code 1 - process.exit(error.status || 1); + // If there's an error executing (status is null or undefined), exit with code 1 + process.exit(error.status ?? 1); }