2024-04-13 05:49:13 +03:00
|
|
|
# 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:
|
2024-04-25 06:56:20 +03:00
|
|
|
platform:
|
|
|
|
- ubuntu-20.04
|
|
|
|
- macos-13
|
|
|
|
- macos-14
|
|
|
|
- windows-2022
|
2024-04-13 05:49:13 +03:00
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: ${{ inputs.commit }}
|
2024-04-25 06:56:20 +03:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18.x
|
|
|
|
- if: ${{ startsWith(matrix.platform, 'windows') }}
|
|
|
|
run: pip.exe install setuptools
|
|
|
|
- if: ${{ !startsWith(matrix.platform, 'windows') && !startsWith(matrix.platform, 'macos') }}
|
|
|
|
run: python3 -m pip install setuptools
|
|
|
|
- if: ${{ startsWith(matrix.platform, 'macos') }}
|
2024-04-13 05:49:13 +03:00
|
|
|
run: python3 -m pip install --break-system-packages setuptools
|
|
|
|
- name: 'Build'
|
2024-04-25 06:56:20 +03:00
|
|
|
run: npx -y prebuildify@6.0.1 --napi --strip
|
|
|
|
working-directory: packages/crypto-node
|
|
|
|
- if: ${{ !startsWith(matrix.platform, 'macos') }}
|
|
|
|
name: 'Build (arm64)'
|
|
|
|
run: npx -y prebuildify@6.0.1 --napi --strip --arch arm64
|
2024-04-13 05:49:13 +03:00
|
|
|
working-directory: packages/crypto-node
|
|
|
|
- name: 'Upload'
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: prebuilt-${{ matrix.platform }}-${{ inputs.hash }}
|
|
|
|
path: packages/crypto-node/prebuilds
|