Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: build-and-release
on:
push:
tags:
- '*'
- "*"
branches:
- develop

Expand Down Expand Up @@ -84,12 +84,13 @@ jobs:
key: v4-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}-fork
restore-keys: |
v4-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}-fork
- name: 'Set GIT_TAG'
- name: "Set GIT_TAG"
if: startsWith(github.ref, 'refs/tags')
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: 'Publish Binary'
- name: "Publish Binary"
run: |
GIT_COMMIT=${{ github.sha }} GIT_TAG=$GIT_TAG ./scripts/ci/build.sh
pip install setuptools
GIT_COMMIT=${{ github.sha }} GIT_TAG=$GIT_TAG RUNNER_OS=${{ runner.os }} ./scripts/ci/build.sh
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -172,11 +173,12 @@ jobs:
key: v4-${{ runner.os }}-libcurl-deps-cache-electron-${{ matrix.electron-version }}-fork
restore-keys: |
v4-${{ runner.os }}-libcurl-deps-cache-electron-${{ matrix.electron-version }}-fork
- name: 'Set GIT_TAG'
- name: "Set GIT_TAG"
if: startsWith(github.ref, 'refs/tags')
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: 'Publish Binary'
- name: "Publish Binary"
run: |
pip install setuptools
GIT_COMMIT=${{ github.sha }} GIT_TAG=$GIT_TAG ./scripts/ci/build.sh
- name: Upload artifacts
if: always()
Expand Down Expand Up @@ -225,6 +227,7 @@ jobs:
- name: Publish binary
if: startsWith(github.ref, 'refs/tags/')
run: |
pip install setuptools
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why it runs pip install setuptools is because it will fail to run node-libcurl/node_modules/node-gyp/gyp/gyp_main.py without this step.

You can get more details here build error

Copy link
Copy Markdown

@jackkav jackkav Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is ModuleNotFoundError: No module named 'distutils'
It would appear distutils was deprecated in python 3.10 https://peps.python.org/pep-0632/
So this error is consistent with the github action ambient version being 3.12 or above.
Its worth mentioning that this step only fails on macos

yarn node-pre-gyp package testpackage --verbose
node scripts\module-packaging.js --publish $(yarn -s node-pre-gyp reveal staged_tarball --silent)

Expand All @@ -241,8 +244,8 @@ jobs:
ELECTRON_VERSION: ${{ matrix.electron-version }}
npm_config_msvs_version: 2022
npm_config_build_from_source: true
npm_config_runtime: 'electron'
npm_config_dist_url: 'https://electronjs.org/headers'
npm_config_runtime: "electron"
npm_config_dist_url: "https://electronjs.org/headers"
npm_config_target: ${{ matrix.electron-version }}
steps:
- name: Checkout
Expand Down Expand Up @@ -273,5 +276,6 @@ jobs:
- name: Publish binary
if: startsWith(github.ref, 'refs/tags/')
run: |
pip install setuptools
yarn node-pre-gyp package testpackage --verbose
node scripts\module-packaging.js --publish $(yarn -s node-pre-gyp reveal staged_tarball --silent)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getinsomnia/node-libcurl",
"version": "2.3.6-21",
"version": "2.4.1-4",
"description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl",
"keywords": [
"node-curl",
Expand Down
4 changes: 3 additions & 1 deletion scripts/ci/build-libcurl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ fi
#####
# ssl
####
if [ ! -z "$OPENSSL_BUILD_FOLDER" ]; then
if [ "${RUNNER_OS}" == "macOS" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we do this only for MacOS, and not only for Linux and Windows?

Copy link
Copy Markdown
Author

@notjaywu notjaywu Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the information from curl doc, Secure Transport is the native implementation of TLS on macOS. It can read the keychain on macOS correctly, but OpenSSL can NOT.

image

Copy link
Copy Markdown
Author

@notjaywu notjaywu Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check if this issue also happens on Windows and Linux tomorrow.

libcurl_args+=("--with-secure-transport")
elif [ ! -z "$OPENSSL_BUILD_FOLDER" ]; then
CPPFLAGS="$CPPFLAGS -I$OPENSSL_BUILD_FOLDER/include"
LDFLAGS="$LDFLAGS -L$OPENSSL_BUILD_FOLDER/lib -Wl,-rpath,$OPENSSL_BUILD_FOLDER/lib"

Expand Down