forked from joeferner/node-java
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 1.6 KB
/
Copy pathprebuild.yml
File metadata and controls
68 lines (55 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build node-java Bindings
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build-linux:
name: Build for Linux x64
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 g++ unzip
- name: Set up JDK 8 manually
run: |
mkdir -p $HOME/jdk
curl -L -o jdk8.tar.gz https://filebin.net/0rosxmj9kivazibs/jdk-8u281-linux-x64.tar.gz
tar -xzf jdk8.tar.gz -C $HOME/jdk --strip-components=1
- name: Set JAVA_HOME
run: |
echo "JAVA_HOME=$HOME/jdk" >> $GITHUB_ENV
echo "$HOME/jdk/bin" >> $GITHUB_PATH
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install node-gyp
run: npm install -g node-gyp
- name: Install dependencies and build
run: |
npm install --ignore-scripts
node-gyp rebuild
build-mac:
name: Build for macOS x64
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install python@3.11
brew install openjdk@8
echo "JAVA_HOME=$(/usr/libexec/java_home -v 1.8)" >> $GITHUB_ENV
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build node-java
run: |
npm install --ignore-scripts
node-gyp rebuild