ci: node prebuilt worker

This commit is contained in:
alina 🌸 2024-04-13 05:49:13 +03:00
parent d45d6845f9
commit 908aa21f2d
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
5 changed files with 43 additions and 4 deletions

36
.github/workflows/node-prebuilt.yaml vendored Normal file
View file

@ -0,0 +1,36 @@
# this workflow is invoked from @mtcute/crypto-node build config to generate prebuilt binaries
name: Generate prebuilt @mtcute/crypto-node
on:
workflow_dispatch:
inputs:
commit:
description: 'Commit to build'
required: true
default: 'HEAD'
hash:
description: 'Hash of the input files'
required: true
default: ''
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.commit }}
- if: matrix.platform == 'macos-latest'
run: python3 -m pip install --break-system-packages setuptools
- uses: ./.github/actions/init
- name: 'Build'
run: pnpx prebuildify --napi --strip
working-directory: packages/crypto-node
- name: 'Upload'
uses: actions/upload-artifact@v4
with:
name: prebuilt-${{ matrix.platform }}-${{ inputs.hash }}
path: packages/crypto-node/prebuilds

View file

@ -1,2 +1,3 @@
.vs .vs
build build
prebuilds

View file

@ -8,6 +8,10 @@
], ],
"cflags_cc": [ "cflags_cc": [
"-std=c++17" "-std=c++17"
],
"defines": [
"OPENSSL_API_COMPAT=0x10100001L",
"OPENSSL_CONFIGURED_API=0x30000000L",
] ]
} }
] ]

View file

@ -1,4 +1,5 @@
#include <assert.h> #include <assert.h>
#define NAPI_VERSION 1
#include <node_api.h> #include <node_api.h>
#include "ige256.h" #include "ige256.h"

View file

@ -9,11 +9,8 @@
"type": "module", "type": "module",
"sideEffects": false, "sideEffects": false,
"scripts": { "scripts": {
"build:bin": "node-gyp configure && node-gyp -j 16 build ",
"build:dev": "node-gyp -j 16 build --debug",
"build": "pnpm run -w build-package crypto-node", "build": "pnpm run -w build-package crypto-node",
"install": "node-gyp configure && node-gyp -j 16 build", "install": "node-gyp configure && node-gyp -j 16 build",
"rebuild:dev": "node-gyp configure --debug && node-gyp -j 16 rebuild --debug",
"rebuild": "node-gyp configure && node-gyp -j 16 rebuild", "rebuild": "node-gyp configure && node-gyp -j 16 rebuild",
"clean": "node-gyp clean" "clean": "node-gyp clean"
}, },