From c9dd3e7155afb067cf2c7ba1432b4a1fe6c4e467 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 9 Nov 2022 18:52:42 +0530 Subject: [PATCH] chore: build macos arm build from macos Signed-off-by: Pranav C --- .../workflows/release-timely-executables.yml | 50 +++++++++++++++---- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-timely-executables.yml b/.github/workflows/release-timely-executables.yml index c5bafc86b7..b4ed607475 100644 --- a/.github/workflows/release-timely-executables.yml +++ b/.github/workflows/release-timely-executables.yml @@ -62,6 +62,10 @@ jobs: ./make.sh sudo cp ./ldid /usr/local/bin + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Update nocodb-timely env: TAG: ${{ github.event.inputs.tag || inputs.tag }} @@ -76,10 +80,6 @@ jobs: git push --tags - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name : Install dependencies and build executables run: | # install npm dependendencies @@ -111,12 +111,12 @@ jobs: # build executables # npm run build - cd ./node_modules/better-sqlite3; - rm -r ./build - npx prebuild-install --platform=darwin --arch=arm64 || npx prebuild --platform=darwin --arch=arm64 - cd ../..; - npx pkg . --compress GZip -t node16-macos-arm64 -o Noco-macos-arm64 - mv ./Noco-macos-arm64 ./mac-dist/ + # cd ./node_modules/better-sqlite3; + # rm -r ./build + # npx prebuild-install --platform=darwin --arch=arm64 || npx prebuild --platform=darwin --arch=arm64 + # cd ../..; + # npx pkg . --compress GZip -t node16-macos-arm64 -o Noco-macos-arm64 + # mv ./Noco-macos-arm64 ./mac-dist/ cd ./node_modules/better-sqlite3; rm -r ./build @@ -159,12 +159,42 @@ jobs: runs-on: macos-latest needs: build-executables steps: + - + - uses: actions/checkout@v3 + with: + token: ${{ secrets.NC_GITHUB_TOKEN }} + repository: 'nocodb/nocodb-timely' - uses: actions/download-artifact@master with: name: ${{ github.event.inputs.tag || inputs.tag }} path: mac-dist + + - name: Install dependencies and build executables + env: + TAG: ${{ github.event.inputs.tag || inputs.tag }} + run: | + + npm i -E nocodb-daily@$TAG + + # 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 + + + # build executables + cd ./node_modules/better-sqlite3; + rm -r ./build + npx prebuild-install --platform=darwin --arch=arm64 || npx prebuild --platform=darwin --arch=arm64 + cd ../..; + npx pkg . --compress GZip -t node16-macos-arm64 -o Noco-macos-arm64 + mv ./Noco-macos-arm64 ./mac-dist/ + + + - name: Sign macOS executables run: | /usr/bin/codesign --force -s - ./mac-dist/Noco-macos-arm64 -v