diff --git a/.github/workflows/release-executables.yml b/.github/workflows/release-executables.yml index fff82b1e69..26d2fa1981 100644 --- a/.github/workflows/release-executables.yml +++ b/.github/workflows/release-executables.yml @@ -18,8 +18,46 @@ on: NC_GITHUB_TOKEN: required: true jobs: + gen-mac-arm64-binaries: + runs-on: macos-latest + steps: + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: actions/checkout@v3 + with: + token: ${{ secrets.NC_GITHUB_TOKEN }} + repository: 'nocodb/nocodb-timely' + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + + - name: Install dependencies and build executables + env: + TAG: ${{ github.event.inputs.tag || inputs.tag }} + run: | + python -V + npm i -E nocodb-daily@$TAG + cat ./package.json + + + # build binaries + cd ./node_modules/better-sqlite3; + rm -r ./build + npx prebuild --arch=arm64 + + - uses: actions/upload-artifact@master + with: + name: ${{ github.event.inputs.tag || inputs.tag }}-bin + path: ./node_modules/better-sqlite3/build/Release + retention-days: 1 + + build-executables: runs-on: ubuntu-latest + needs: gen-mac-arm64-binaries steps: # Get the latest draft release for asset upload url - uses: cardinalby/git-get-release-action@v1 @@ -70,6 +108,11 @@ jobs: ./make.sh sudo cp ./ldid /usr/local/bin + - uses: actions/download-artifact@master + with: + name: ${{ github.event.inputs.tag || inputs.tag }}-bin + path: ./Release + - uses: actions/setup-node@v3 with: node-version: 16 @@ -84,28 +127,61 @@ jobs: # install npm dependendencies npm i - # Build sqlite binaries for all platforms - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=x64 --target_libc=unknown - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=ia32 --target_libc=unknown - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=x64 --target_libc=unknown - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=arm64 --target_libc=unknown - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=glibc - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=glibc - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=musl - ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=musl - # clean up code to optimize size - npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,sqlite3/**" --run + npx modclean --patterns="default:*" --ignore="nc-lib-gui-daily/**,dayjs/**,express-status-monitor/**,better-sqlite3/**" --run - # build executables - npm run build + # create build directory + mkdir ./dist + mkdir ./mac-dist + + # build macos arm64 executable + mkdir -p ./node_modules/better-sqlite3/build/Release/ + rsync -rvzhP ./Release/ ./node_modules/better-sqlite3/build/Release/ + npx pkg . --compress GZip -t node16-macos-arm64 -o Noco-macos-arm64 + mv ./Noco-macos-arm64 ./mac-dist/ + + # build macos x64 executable + cd ./node_modules/better-sqlite3; + rm -r ./build + npx prebuild-install --platform=darwin --arch=x64 || npx prebuild --platform=darwin --arch=x64 + cd ../..; + npx pkg . --compress GZip -t node16-macos-x64 -o Noco-macos-x64 + mv ./Noco-macos-x64 ./mac-dist/ + + # build linux x64 executable + cd ./node_modules/better-sqlite3; + rm -r ./build + npx prebuild-install --platform=linux --arch=x64 || npx prebuild --platform=linux --arch=x64 + cd ../..; + npx pkg . --compress GZip -t node16-linux-x64 -o Noco-linux-x64 + mv ./Noco-linux-x64 ./dist/ + + # build linux arm64 executable + cd ./node_modules/better-sqlite3; + rm -r ./build + npx prebuild-install --platform=linux --arch=arm64 || npx prebuild --platform=linux --arch=arm64 + cd ../..; + npx pkg . --compress GZip -t node16-linux-arm64 -o Noco-linux-arm64 + mv ./Noco-linux-arm64 ./dist/ + + + # build windows x64 executable + cd ./node_modules/better-sqlite3; + rm -r ./build + npx prebuild-install --platform=win32 --arch=x64 || npx prebuild --platform=win32 --arch=x64 + cd ../..; + npx pkg . --compress GZip -t node16-win-x64 -o Noco-win-x64.exe + mv ./Noco-win-x64.exe ./dist/ + + # build windows arm64 executable + cd ./node_modules/better-sqlite3; + rm -r ./build + npx prebuild-install --platform=win32 --arch=arm64 || npx prebuild --platform=win32 --arch=arm64 + cd ../..; + npx pkg . --compress GZip -t node16-win-arm64 -o Noco-win-arm64.exe + mv ./Noco-win-arm64.exe ./dist/ - ls ./dist - # Move macOS executables for signing - mkdir ./mac-dist - mv ./dist/Noco-macos-arm64 ./mac-dist/ - mv ./dist/Noco-macos-x64 ./mac-dist/ - name: Upload win-arm64 build to asset id: upload-release-asset diff --git a/.github/workflows/release-timely-executables.yml b/.github/workflows/release-timely-executables.yml index 573dbc444b..53c840b875 100644 --- a/.github/workflows/release-timely-executables.yml +++ b/.github/workflows/release-timely-executables.yml @@ -130,8 +130,6 @@ jobs: # install npm dependendencies npm i - - # clean up code to optimize size npx modclean --patterns="default:*" --ignore="nc-lib-gui-daily/**,dayjs/**,express-status-monitor/**,better-sqlite3/**" --run diff --git a/scripts/pkg-executable/binaries/binding/napi-v3-darwin-arm64/node_sqlite3.node b/scripts/pkg-executable/binaries/binding/napi-v3-darwin-arm64/node_sqlite3.node deleted file mode 100755 index 0741ec33a4..0000000000 Binary files a/scripts/pkg-executable/binaries/binding/napi-v3-darwin-arm64/node_sqlite3.node and /dev/null differ diff --git a/scripts/pkg-executable/binaries/binding/napi-v3-darwin-x64/node_sqlite3.node b/scripts/pkg-executable/binaries/binding/napi-v3-darwin-x64/node_sqlite3.node deleted file mode 100755 index 078ce25dc5..0000000000 Binary files a/scripts/pkg-executable/binaries/binding/napi-v3-darwin-x64/node_sqlite3.node and /dev/null differ diff --git a/scripts/pkg-executable/binaries/binding/napi-v3-linux-x64/node_sqlite3.node b/scripts/pkg-executable/binaries/binding/napi-v3-linux-x64/node_sqlite3.node deleted file mode 100755 index 100124214a..0000000000 Binary files a/scripts/pkg-executable/binaries/binding/napi-v3-linux-x64/node_sqlite3.node and /dev/null differ diff --git a/scripts/pkg-executable/binaries/binding/napi-v3-win32-ia32/node_sqlite3.node b/scripts/pkg-executable/binaries/binding/napi-v3-win32-ia32/node_sqlite3.node deleted file mode 100644 index c355fd9d78..0000000000 Binary files a/scripts/pkg-executable/binaries/binding/napi-v3-win32-ia32/node_sqlite3.node and /dev/null differ diff --git a/scripts/pkg-executable/binaries/binding/napi-v3-win32-x64/node_sqlite3.node b/scripts/pkg-executable/binaries/binding/napi-v3-win32-x64/node_sqlite3.node deleted file mode 100644 index 2a16da4ef8..0000000000 Binary files a/scripts/pkg-executable/binaries/binding/napi-v3-win32-x64/node_sqlite3.node and /dev/null differ