Skip to content

Commit

Permalink
add node_16 Withssl (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang authored Sep 14, 2022
1 parent 44b3261 commit e6970c1
Show file tree
Hide file tree
Showing 6 changed files with 344 additions and 11 deletions.
287 changes: 287 additions & 0 deletions .github/workflows/build_16_withssl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
name: build nodejs v16 withssl (preview)

on:
workflow_dispatch:
inputs:
tag_date:
description: 'tag date'
required: true

env:
VERSION: 16.16.0

jobs:
build_windows:
name: Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Run build script
continue-on-error: true
shell: cmd
run: |
cd %GITHUB_WORKSPACE%
call .\windows_trybuild.cmd ${{env.VERSION}}
- name: Run upload script
shell: cmd
run: |
cd %GITHUB_WORKSPACE%
call .\windows_64.cmd
- name: Rename
shell: bash
run: |
mv puerts-node/nodejs puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: puerts-node/**/*

build_windows_32:
name: Windows-32
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Run build script
continue-on-error: true
shell: cmd
run: |
cd %GITHUB_WORKSPACE%
call .\windows_trybuild.cmd ${{env.VERSION}}
- name: Run upload script
shell: cmd
run: |
cd %GITHUB_WORKSPACE%
call .\windows_32.cmd
- name: Rename
shell: bash
run: |
mv puerts-node/nodejs puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: puerts-node/**/*

build_macos:
name: macOS
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Run build script
run: |
cd $GITHUB_WORKSPACE
sh ./macos.sh ${{env.VERSION}}
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

build_macos_arm64:
name: macOS with apple m1
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Run build script
run: |
cd $GITHUB_WORKSPACE
sh ./macos_arm64.sh ${{env.VERSION}}
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

build_ios:
name: iOS
runs-on: macos-11
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12'
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Run build script
run: |
cd $GITHUB_WORKSPACE
sh ./ios.sh ${{env.VERSION}} 1
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

build_linux:
name: linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Run build script
run: |
cd $GITHUB_WORKSPACE
sh ./linux.sh ${{env.VERSION}}
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

build_android_arm64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Install NDK
run: |
cd ~
wget -O NDK -q https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip
sudo apt install unzip -y
unzip -q NDK
- name: Build
run: |
cd $GITHUB_WORKSPACE
sh ./android.sh ${{env.VERSION}} arm64 1
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

build_android_armv7:
runs-on: ubuntu-latest
steps:
- name: Install gcc-multilib g++-multilib
run: |
sudo apt-get install gcc-multilib g++-multilib
- uses: actions/checkout@v2
- name: Install NDK
run: |
cd ~
wget -O NDK -q https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip
sudo apt install unzip -y
unzip -q NDK
- name: Build
run: |
cd $GITHUB_WORKSPACE
sh ./android.sh ${{env.VERSION}} arm 1
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

build_android_arm64_static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install
shell: bash
run: npm install
- name: Install NDK
run: |
cd ~
wget -O NDK -q https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip
sudo apt install unzip -y
unzip -q NDK
- name: Build
run: |
cd $GITHUB_WORKSPACE
bash ./android-static.sh ${{env.VERSION}} arm64 1
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

build_android_armv7_static:
runs-on: ubuntu-latest
steps:
- name: Install gcc-multilib g++-multilib
run: |
sudo apt-get install gcc-multilib g++-multilib
- uses: actions/checkout@v2
- name: Install NDK
run: |
cd ~
wget -O NDK -q https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip
sudo apt install unzip -y
unzip -q NDK
- name: Build
run: |
cd $GITHUB_WORKSPACE
bash ./android-static.sh ${{env.VERSION}} arm 1
- name: Rename
run: |
mv ~/puerts-node/nodejs ~/puerts-node/nodejs_16
- uses: actions/upload-artifact@v2
with:
name: nodejs_bin
path: ~/puerts-node/**/*

publish:
runs-on: ubuntu-latest
needs: [build_windows,build_windows_32,build_macos,build_macos_arm64,build_linux,build_ios,build_android_arm64,build_android_armv7,build_android_arm64_static,build_android_armv7_static]
steps:
- uses: actions/download-artifact@v1
with:
name: nodejs_bin
path: nodejs_bin/

- name: Create Release Asset
run: |
cd nodejs_bin/ && tar cvfz ../nodejs_bin_${{env.VERSION}}.tgz nodejs_16 && cd -
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: NodeJS_${{env.VERSION}}_${{ github.event.inputs.tag_date }}
release_name: NodeJS_${{env.VERSION}}_${{ github.event.inputs.tag_date }}
draft: false
prerelease: false

- name: Upload nodejs_bin
#id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nodejs_bin_${{env.VERSION}}.tgz
asset_name: nodejs_bin_${{env.VERSION}}.tgz
asset_content_type: application/tgz

24 changes: 19 additions & 5 deletions android-configure
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
# modules with npm. Also, don't forget to set the arch in npm config using
# 'npm config set arch=<arch>'

if [ $# -ne 3 ]; then
echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
exit 1
fi
# if [ $# -ne 3 ]; then
# echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
# exit 1
# fi

NDK_PATH=$1
ARCH="$2"
ANDROID_SDK_VERSION=$3
WITH_SSL=$4

if [ $ANDROID_SDK_VERSION -lt 23 ]; then
echo "$ANDROID_SDK_VERSION should equal or later than 23(Android 6.0)"
Expand Down Expand Up @@ -82,6 +83,7 @@ GYP_DEFINES+=" host_os=$HOST_OS OS=android"
export GYP_DEFINES

if [ -f "configure" ]; then
if [ $WITH_SSL == "" ]; then
./configure \
--dest-cpu=$DEST_CPU \
--dest-os=android \
Expand All @@ -92,4 +94,16 @@ if [ -f "configure" ]; then
--shared \
--no-browser-globals \
--cross-compiling
fi
else
./configure \
--dest-cpu=$DEST_CPU \
--dest-os=android \
--without-snapshot \
--openssl-no-asm \
--partly-static \
--with-intl=none \
--shared \
--no-browser-globals \
--cross-compiling
fi
fi
22 changes: 18 additions & 4 deletions android-configure-static
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
# modules with npm. Also, don't forget to set the arch in npm config using
# 'npm config set arch=<arch>'

if [ $# -ne 3 ]; then
echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
exit 1
fi
# if [ $# -ne 3 ]; then
# echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
# exit 1
# fi

NDK_PATH=$1
ARCH="$2"
ANDROID_SDK_VERSION=$3
WITH_SSL=$4

if [ $ANDROID_SDK_VERSION -lt 23 ]; then
echo "$ANDROID_SDK_VERSION should equal or later than 23(Android 6.0)"
Expand Down Expand Up @@ -81,7 +82,9 @@ GYP_DEFINES+=" android_target_arch=$ARCH"
GYP_DEFINES+=" host_os=$HOST_OS OS=android"
export GYP_DEFINES


if [ -f "configure" ]; then
if [ $WITH_SSL == "" ]; then
./configure \
--dest-cpu=$DEST_CPU \
--dest-os=android \
Expand All @@ -91,4 +94,15 @@ if [ -f "configure" ]; then
--enable-static \
--no-browser-globals \
--cross-compiling
else
./configure \
--dest-cpu=$DEST_CPU \
--dest-os=android \
--without-snapshot \
--openssl-no-asm \
--with-intl=none \
--enable-static \
--no-browser-globals \
--cross-compiling
fi
fi
Loading

0 comments on commit e6970c1

Please sign in to comment.