Build for GNULinux #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build for GNULinux | |
on: workflow_dispatch | |
jobs: | |
build-x86: | |
runs-on: ubuntu-latest | |
container: | |
image: wolframresearch/wolframengine:14.2 | |
options: --user root | |
env: | |
WOLFRAM_SYSTEM_ID: Linux-x86-64-v8 | |
steps: | |
- name: Install build tools | |
run: | | |
apt-get -y update | |
apt-get -y install build-essential | |
apt-get -y install libuv1-dev | |
- name: Install Git in container | |
run: | | |
apt-get -y update | |
apt-get -y install git | |
# one time fix to avoid permission problems later on | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
# Checks-out the repository under $GITHUB_WORKSPACE. | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '23' | |
- name: Patch specific dependencies from package.json | |
run: | | |
cat << 'EOF' > clean-package-json.js | |
const fs = require('fs'); | |
const path = './package.json'; | |
const pkg = JSON.parse(fs.readFileSync(path, 'utf8')); | |
const depsToRemove = [ | |
"dmg-license", | |
"electron-trackpad-utils" | |
]; | |
['dependencies', 'devDependencies'].forEach(section => { | |
if (pkg[section]) { | |
depsToRemove.forEach(dep => { | |
delete pkg[section][dep]; | |
}); | |
} | |
}); | |
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n'); | |
EOF | |
node clean-package-json.js | |
rm clean-package-json.js | |
- name: Install dependencies | |
run: npm install | |
- name: Bundle | |
env: | |
WOLFRAMSCRIPT_ENTITLEMENTID: ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }} | |
run: | | |
npm run pre-dist | |
- name: Build electron | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: npm run dist-linux86 | |
build-ARM: | |
runs-on: ubuntu-24.04-arm | |
env: | |
WOLFRAM_SYSTEM_ID: Linux-ARM | |
WOLFRAMENGINE_CACHE_KEY: WolframEngine-BA | |
WOLFRAMENGINE_INSTALLATION_DIRECTORY: "/Applications/Wolfram Engine.app" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Install Ruby and dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ruby ruby-dev build-essential | |
- name: Install FPM gem | |
run: | | |
sudo gem install fpm | |
- name: Set environment for FPM | |
run: | | |
echo "USE_SYSTEM_FPM=true" >> $GITHUB_ENV | |
echo 'GEM_HOME="$(ruby -e "puts Gem.user_dir")"' >> $GITHUB_ENV | |
echo 'PATH="$PATH:$GEM_HOME/bin"' >> $GITHUB_ENV | |
- name: Display Ruby and FPM info | |
run: | | |
echo "Ruby version: $(ruby -v)" | |
echo "FPM version: $(fpm --version)" | |
- name: Install WE | |
run: | | |
set -eux -o pipefail | |
chmod +x ./.github/workflows/install_arm.sh | |
WE_MODE=install bash ./.github/workflows/install_arm.sh | |
sudo apt install libuv1-dev -y | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '23' | |
- name: Patch specific dependencies from package.json | |
run: | | |
cat << 'EOF' > clean-package-json.js | |
const fs = require('fs'); | |
const path = './package.json'; | |
const pkg = JSON.parse(fs.readFileSync(path, 'utf8')); | |
const depsToRemove = [ | |
"dmg-license", | |
"electron-trackpad-utils" | |
]; | |
['dependencies', 'devDependencies'].forEach(section => { | |
if (pkg[section]) { | |
depsToRemove.forEach(dep => { | |
delete pkg[section][dep]; | |
}); | |
} | |
}); | |
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n'); | |
EOF | |
node clean-package-json.js | |
rm clean-package-json.js | |
- name: Install dependencies | |
run: npm install | |
- name: Bundle | |
env: | |
WOLFRAMSCRIPT_ENTITLEMENTID: ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }} | |
run: | | |
/opt/Wolfram/WolframEngine/14.1/SystemFiles/Kernel/Binaries/Linux-ARM64/wolframscript -debug -verbose -script ./Scripts/bundle.wls | |
- name: Build electron | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: npm run dist-linux |