From 0f469ade167a9221ebf4bcd9f9ee92689733161b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 15 Aug 2024 00:09:01 +0530 Subject: [PATCH 1/2] chore: timely executable build action related bugs Signed-off-by: Pranav C --- .../workflows/release-timely-executables.yml | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-timely-executables.yml b/.github/workflows/release-timely-executables.yml index c844945b71..5076522151 100644 --- a/.github/workflows/release-timely-executables.yml +++ b/.github/workflows/release-timely-executables.yml @@ -81,7 +81,7 @@ jobs: - name : Install dependencies and build executables run: | - # install npm dependendencies + # install npm dependencies npm i # Copy sqlite binaries @@ -96,17 +96,52 @@ jobs: ./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 - - # ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=armv6 --target_libc=unknown - # ./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=armv7 --target_libc=unknown - - + + + mkdir ./mac-dist + mkdir ./dist + + # build darwin x64 executable + npm uninstall sharp + npm install --cpu=x64 --os=darwin sharp + npx --yes pkg@5.8.1 . --compress GZip -t node18-macos-x64 -o Noco-macos-x64 + mv ./Noco-macos-x64 ./mac-dist/ + + # build darwin arm64 executable + npm uninstall sharp + npm install --cpu=arm64 --os=darwin sharp + npx --yes pkg@5.8.1 . --compress GZip -t node18-macos-arm64 -o Noco-macos-arm64 + mv ./Noco-macos-arm64 ./mac-dist/ + + + # build linux x64 executable + npm uninstall sharp + npm install --cpu=x64 --os=linux sharp + npx --yes pkg@5.8.1 . --compress GZip -t node18-linux-x64 -o Noco-linux-x64 + mv ./Noco-linux-x64 ./dist/ + + # build linux arm64 executable + npm uninstall sharp + npm install --cpu=arm64 --os=linux sharp + npx --yes pkg@5.8.1 . --compress GZip -t node18-linux-arm64 -o Noco-linux-arm64 + mv ./Noco-linux-arm64 ./dist/ + + + # build windows x64 executable + npm uninstall sharp + npm install --cpu=x64 --os=win32 sharp + npx --yes pkg@5.8.1 . --compress GZip -t node18-win-x64 -o Noco-win-x64.exe + mv ./Noco-win-x64.exe ./dist/ + + # build windows arm64 executable + npm uninstall sharp + npm install --cpu=arm64 --os=win32 sharp + npx --yes pkg@5.8.1 . --compress GZip -t node18-win-arm64 -o Noco-win-arm64.exe + mv ./Noco-win-arm64.exe ./dist/ + # clean up code to optimize size npx modclean --patterns="default:*" --ignore="nc-lib-gui-daily/**,nocodb-daily/**,dayjs/**,express-status-monitor/**,sqlite3/**" --run - - # build executables - npm run build - + mkdir ./mac-dist mv ./dist/Noco-macos-arm64 ./mac-dist/ mv ./dist/Noco-macos-x64 ./mac-dist/ @@ -144,7 +179,7 @@ jobs: - uses: actions/upload-artifact@master with: - name: ${{ github.event.inputs.tag || inputs.tag }} + name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }} path: mac-dist retention-days: 1 @@ -155,7 +190,7 @@ jobs: steps: - uses: actions/download-artifact@master with: - name: ${{ github.event.inputs.tag || inputs.tag }} + name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }} path: mac-dist - name: Upload mac executables to release From e725173e3ef07fb4a5734a3aeb87332ecd714389 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 15 Aug 2024 01:17:27 +0530 Subject: [PATCH 2/2] chore: skip dir creation if already exist Signed-off-by: Pranav C --- .github/workflows/release-timely-executables.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-timely-executables.yml b/.github/workflows/release-timely-executables.yml index 5076522151..5c345fe53b 100644 --- a/.github/workflows/release-timely-executables.yml +++ b/.github/workflows/release-timely-executables.yml @@ -97,9 +97,11 @@ jobs: ./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-daily/**,nocodb-daily/**,dayjs/**,express-status-monitor/**,sqlite3/**" --run - mkdir ./mac-dist - mkdir ./dist + mkdir -p ./mac-dist + mkdir -p ./dist # build darwin x64 executable npm uninstall sharp @@ -138,13 +140,6 @@ jobs: npm install --cpu=arm64 --os=win32 sharp npx --yes pkg@5.8.1 . --compress GZip -t node18-win-arm64 -o Noco-win-arm64.exe mv ./Noco-win-arm64.exe ./dist/ - - # clean up code to optimize size - npx modclean --patterns="default:*" --ignore="nc-lib-gui-daily/**,nocodb-daily/**,dayjs/**,express-status-monitor/**,sqlite3/**" --run - - mkdir ./mac-dist - mv ./dist/Noco-macos-arm64 ./mac-dist/ - mv ./dist/Noco-macos-x64 ./mac-dist/ - name: Upload executables(except mac executables) to release uses: svenstaro/upload-release-action@v2