Skip to content

Build custom native modules for studio #42

Build custom native modules for studio

Build custom native modules for studio #42

name: Build custom native modules for studio
on:
workflow_dispatch:
workflow_run:
workflows:
- Discover native modules for studio
types:
- completed
jobs:
build-for-linux:
## for backward compatibility with old GLIBC
runs-on: ubuntu-20.04
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: actions/setup-node@v4
with:
cache: npm
node-version: 22
- name: Install krb5
run: |
sudo apt-get update
sudo apt-get install -y libkrb5-dev
- name: install python distutils
run: python3 -m pip install packaging
- name: Install toolkit
run: npm ci
- name: Set Electron Major version in env
run: echo "ELECTRON_MAJOR_VERSION=$(node ./bin/get-electron-major-version.js)" >> $GITHUB_ENV
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v5
with:
# Optional, GitHub token, a Personal Access Token with `public_repo` scope if needed
# Required, if the artifact is from a different repo
# Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read`
github_token: ${{secrets.GITHUB_TOKEN}}
# Optional, workflow file name or ID
# If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow
workflow: discover-native-modules.yml
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Or a workflow status:
# "completed", "in_progress", "queued"
# Use the empty string ("") to ignore status or conclusion in the search
workflow_conclusion: success
name: modulesToBuildForElectron-${{ env.ELECTRON_MAJOR_VERSION }}
- name: Build native modules on Linux x64
run: npm run rebuild-for-target
build-mac-arm:
runs-on: macos-14
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: actions/setup-node@v4
with:
cache: npm
node-version: 18
- name: install python setuptools for workaround https://github.com/nodejs/node-gyp/issues/2869
run: brew install python-setuptools
- name: Install toolkit
run: npm ci
- name: Set Electron Major version in env
run: echo "ELECTRON_MAJOR_VERSION=$(node ./bin/get-electron-major-version.js)" >> $GITHUB_ENV
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v5
with:
# Optional, GitHub token, a Personal Access Token with `public_repo` scope if needed
# Required, if the artifact is from a different repo
# Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read`
github_token: ${{secrets.GITHUB_TOKEN}}
# Optional, workflow file name or ID
# If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow
workflow: discover-native-modules.yml
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Or a workflow status:
# "completed", "in_progress", "queued"
# Use the empty string ("") to ignore status or conclusion in the search
workflow_conclusion: success
name: modulesToBuildForElectron-${{ env.ELECTRON_MAJOR_VERSION }}
- name: Build native modules on Mac OS arm64
run: npm run rebuild-for-target
build-mac-intel:
# Pinned down version of mac os runner is the last one with intel
runs-on: macos-13
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: actions/setup-node@v4
with:
cache: npm
node-version: 18
- name: install python setuptools for workaround https://github.com/nodejs/node-gyp/issues/2869
run: pip install setuptools
- name: Install toolkit
run: npm ci
- name: Set Electron Major version in env
run: echo "ELECTRON_MAJOR_VERSION=$(node ./bin/get-electron-major-version.js)" >> $GITHUB_ENV
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v5
with:
# Optional, GitHub token, a Personal Access Token with `public_repo` scope if needed
# Required, if the artifact is from a different repo
# Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read`
github_token: ${{secrets.GITHUB_TOKEN}}
# Optional, workflow file name or ID
# If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow
workflow: discover-native-modules.yml
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Or a workflow status:
# "completed", "in_progress", "queued"
# Use the empty string ("") to ignore status or conclusion in the search
workflow_conclusion: success
name: modulesToBuildForElectron-${{ env.ELECTRON_MAJOR_VERSION }}
- name: Build native modules on Mac OS x64
run: npm run rebuild-for-target
build-windows-intel:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: actions/setup-node@v4
with:
cache: npm
node-version: 22
- name: Install MIT Kerberos
run: choco install -y --limit-output mitkerberos --ia=ADDLOCAL=all --ignore-package-exit-codes
- name: Get MIT Kerberos path
run: |
$krb_path=(Get-ItemProperty -Path 'HKLM:/SOFTWARE/MIT/Kerberos/SDK/4.1.0').PathName.replace('\', '/')
echo "GYP_DEFINES=KRB_PATH='$krb_path'" >> $env:GITHUB_ENV
id: mit_kerberos
- name: Install tookit dependencies
run: |
npm.cmd --version
npx.cmd --version
- name: Install tookit dependencies
run: npm ci
- name: Set Electron Major version in env
run: echo "ELECTRON_MAJOR_VERSION=$(node ./bin/get-electron-major-version.js)" >> $env:GITHUB_ENV
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v5
with:
# Optional, GitHub token, a Personal Access Token with `public_repo` scope if needed
# Required, if the artifact is from a different repo
# Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read`
github_token: ${{secrets.GITHUB_TOKEN}}
# Optional, workflow file name or ID
# If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow
workflow: discover-native-modules.yml
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Or a workflow status:
# "completed", "in_progress", "queued"
# Use the empty string ("") to ignore status or conclusion in the search
workflow_conclusion: success
name: modulesToBuildForElectron-${{ env.ELECTRON_MAJOR_VERSION }}
- name: Build on Windows x64
run: npm run rebuild-for-target
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}