Skip to content

Commit

Permalink
0.0.99
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Jul 19, 2024
1 parent a39ca34 commit 468f3f8
Show file tree
Hide file tree
Showing 20 changed files with 461 additions and 117 deletions.
84 changes: 61 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
permissions:
contents: write
id-token: write
'on':
on:
push:
branches:
- main
Expand All @@ -22,6 +22,7 @@ permissions:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
Expand All @@ -32,52 +33,83 @@ jobs:
target: x86_64-apple-darwin
build: yarn build --target x86_64-apple-darwin
- host: windows-latest
build: yarn build --target x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
build: yarn build --target x86_64-pc-windows-msvc
- host: windows-latest
target: i686-pc-windows-msvc
build: |
choco install openssl.light
set OPENSSL_LIB_DIR=C:\Program Files\OpenSSL\lib
set OPENSSL_INCLUDE_DIR=C:\Program Files\OpenSSL\include
yarn build --target i686-pc-windows-msvc
yarn test
target: i686-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
setup: |
sudo apt-get update
sudo apt-get install -y gcc build-essential cmake openssl libssl-dev ca-certificates libc6 perl
build: yarn build --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
setup: |
sudo apt-get update && sudo apt-get install -y build-essential pkg-config cmake musl-tools musl-dev openssl libssl-dev ca-certificates gcc g++ libc6
export CC=musl-gcc
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: yarn build --target x86_64-unknown-linux-musl
env:
CXXFLAGS: '--stdlib=libc++ -L/usr/lib/llvm-18/lib -static'
- host: macos-latest
target: aarch64-apple-darwin
build: yarn build --target aarch64-apple-darwin
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
setup: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu build-essential cmake openssl libssl-dev ca-certificates gcc libc6 perl
build: yarn build --target aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
setup: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf -y
build: |
yarn build --target armv7-unknown-linux-gnueabihf
sudo apt-get install build-essential pkg-config perl gcc cmake libc6 ca-certificates openssl libssl-dev gcc-arm-linux-gnueabihf -y
build: yarn build --target armv7-unknown-linux-gnueabihf
env:
CXXFLAGS: '--stdlib=libc++ -L/usr/lib/llvm-18/lib -static'
- host: ubuntu-latest
target: aarch64-linux-android
setup: |
sudo apt-get update
sudo apt-get install -y build-essential cmake openssl libssl-dev openssl
build: yarn build --target aarch64-linux-android

- host: ubuntu-latest
target: armv7-linux-androideabi
setup: |
sudo apt-get update
sudo apt-get install -y build-essential cmake openssl libssl-dev perl libc6 gcc ca-certificates
build: yarn build --target armv7-linux-androideabi

- host: ubuntu-latest
target: aarch64-unknown-linux-musl
setup: |
sudo apt-get update && sudo apt-get install -y pkg-config build-essential musl-tools musl-dev ca-certificates gcc g++ libc6 perl openssl libssl-dev
export CC=musl-gcc
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
build: |
set -e &&
rustup target add aarch64-unknown-linux-musl &&
rustup target add aarch64-unknown-linux-musl &&
yarn build --target aarch64-unknown-linux-musl
env:
CXXFLAGS: '--stdlib=libc++ -L/usr/lib/llvm-18/lib -static'
- host: windows-latest
target: aarch64-pc-windows-msvc
build: yarn build --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
build: |
choco install openssl.light
set OPENSSL_LIB_DIR=C:\Program Files\OpenSSL-Win64\lib
set OPENSSL_INCLUDE_DIR=C:\Program Files\OpenSSL-Win64\include
yarn build --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@20
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -111,10 +143,6 @@ jobs:
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Setup node x86
if: matrix.settings.target == 'i686-pc-windows-msvc'
run: yarn config set supportedArchitectures.cpu "ia32"
shell: bash
- name: Install dependencies
run: yarn --no-immutable
- name: Setup node x86
Expand All @@ -141,29 +169,30 @@ jobs:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error

build-freebsd:
runs-on: macos-13
runs-on: macos-12
name: Build FreeBSD
steps:
- uses: actions/checkout@v4
- name: Build
id: build
uses: cross-platform-actions/action@v0.24.0
uses: cross-platform-actions/action@v0.21.0
env:
DEBUG: napi:*
RUSTUP_IO_THREADS: 1
with:
operating_system: freebsd
version: '13.2'
memory: 8G
memory: 13G
cpu_count: 3
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
environment_variables: DEBUG RUSTUP_IO_THREADS
shell: bash
run: |
sudo pkg install -y -f curl node libnghttp2 npm
sudo npm install -g yarn --ignore-scripts
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain beta
sh rustup.sh -y --profile minimal --default-toolchain stable
source "$HOME/.cargo/env"
echo "~~~~ rustc --version ~~~~"
rustc --version
Expand All @@ -176,17 +205,20 @@ jobs:
whoami
env
freebsd-version
yarn --no-immutable
yarn install
yarn build
strip -x *.node
yarn test
rm -rf node_modules
rm -rf target
rm -rf .yarn/cache
- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: bindings-freebsd
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error

test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
needs:
Expand Down Expand Up @@ -228,6 +260,7 @@ jobs:
shell: bash
- name: Test bindings
run: yarn test

test-linux-x64-gnu-binding:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
needs:
Expand Down Expand Up @@ -258,6 +291,7 @@ jobs:
shell: bash
- name: Test bindings
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test

test-linux-x64-musl-binding:
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
needs:
Expand Down Expand Up @@ -290,6 +324,7 @@ jobs:
shell: bash
- name: Test bindings
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-alpine yarn test

test-linux-aarch64-gnu-binding:
name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }}
needs:
Expand Down Expand Up @@ -330,6 +365,7 @@ jobs:
set -e
yarn test
ls -la
test-linux-aarch64-musl-binding:
name: Test bindings on aarch64-unknown-linux-musl - node@lts
needs:
Expand Down Expand Up @@ -363,6 +399,7 @@ jobs:
run: |
set -e
yarn test
test-linux-arm-gnueabihf-binding:
name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
needs:
Expand Down Expand Up @@ -402,6 +439,7 @@ jobs:
set -e
yarn test
ls -la
publish:
name: Publish
runs-on: ubuntu-latest
Expand Down Expand Up @@ -447,4 +485,4 @@ jobs:
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 13 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
nodeLinker: node-modules

npmAuditRegistry: "https://registry.npmjs.org"

yarnPath: .yarn/releases/yarn-4.3.1.cjs
yarnPath: .yarn/releases/yarn-4.3.1.cjs
supportedArchitectures:
cpu:
- ia32
- x64
- arm
- arm64
- freebsd
- macos
- windows
- linux
- gnu
- musl
17 changes: 15 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,33 @@ napi-derive = "2"
num_cpus = "1"
serde = "1"
serde_json = "1"
spider = { version = "1.98.4", features = ["napi", "cron", "regex", "cookies", "socks", "chrome", "control", "chrome_intercept", "cache", "openai", "serde", "real_browser" ] }
spider = { version = "1.99.5", features = ["napi", "cron", "regex", "cookies", "socks", "chrome", "control", "chrome_intercept", "cache", "openai", "serde", "real_browser", "headers" ] }

[target.x86_64-unknown-linux-gnu.dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
openssl = { version = "0.10", features = ["vendored"] }

[target.aarch64-unknown-linux-musl.dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
openssl = { version = "0.10", features = ["vendored"] }

[target.armv7-unknown-linux-gnueabihf.dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
openssl = { version = "0.10", features = ["vendored"] }

[target.x86_64-unknown-linux-musl.dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
openssl = { version = "0.10", features = ["vendored"] }

[target.arch64-linux-android.dependencies]
[target.armv7-linux-androideabi.dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
openssl = { version = "0.10", features = ["vendored"] }

[target.aarch64-linux-android.dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
openssl = { version = "0.10", features = ["vendored"] }


[build-dependencies]
napi-build = "2"

Expand Down
2 changes: 1 addition & 1 deletion npm/android-arm-eabi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-android-arm-eabi",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"android"
Expand Down
2 changes: 1 addition & 1 deletion npm/android-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-android-arm64",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"android"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-darwin-arm64",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-universal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-darwin-universal",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-darwin-x64",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/freebsd-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-freebsd-x64",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"freebsd"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm-gnueabihf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-arm-gnueabihf",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-arm64-gnu",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-arm64-musl",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-x64-gnu",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-x64-musl",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-win32-arm64-msvc",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"win32"
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-ia32-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-win32-ia32-msvc",
"version": "0.0.91",
"version": "0.0.99",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"win32"
Expand Down
Loading

0 comments on commit 468f3f8

Please sign in to comment.