File tree Expand file tree Collapse file tree 5 files changed +28
-2
lines changed Expand file tree Collapse file tree 5 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ node_modules/
55
66build /
77npm-debug.log 
8+ prebuilds /
Original file line number Diff line number Diff line change 2525    "minimist" : " ^1.2.0" 
2626    "nodeos-cross-toolchain" : " ^1.0.0-RC3.0" 
2727    "nodeos-nodejs" : " NodeOS/nodejs" 
28+     "prebuild" : " ^6.0.0" 
2829    "qemu" : " ^2.8.0" 
2930    "suppose" : " ^0.6.1" 
3031  },
Original file line number Diff line number Diff line change @@ -13,3 +13,12 @@ TEST="npm test"
1313eval  MACHINE=pc BITS=32 $BUILD  &&  $TEST  ||  exit  1
1414eval  MACHINE=pc BITS=64 $BUILD  &&  $TEST  ||  exit  2
1515eval  MACHINE=raspi2     $BUILD           ||  exit  3
16+ 
17+ 
18+ # 
19+ #  Upload release to GitHub
20+ # 
21+ 
22+ if  [ " $GITHUB_TOKEN " ;  then 
23+   prebuild --upload-all $GITHUB_TOKEN  ||  exit  10
24+ fi 
Original file line number Diff line number Diff line change @@ -46,13 +46,16 @@ SRC_LINUX=`pwd`/deps/linux
4646#  Define steps paths
4747# 
4848
49+ NODE_PLATFORM=linux
50+ 
4951OBJ_INIT=$OBJECTS /init
5052OBJ_NODE=$OBJECTS /node
5153OBJ_RELEASE=$OBJECTS /os-release
5254OBJ_CPIO_TXT=$OBJECTS /cpio.txt
5355OBJ_GEN_INIT_CPIO=$OBJECTS /gen_init_cpio
5456OBJ_LINUX=$OBJECTS /linux
5557OUT_DIR=` pwd` $CPU 
58+ PREBUILD=prebuilds/$NODE_PLATFORM -$NODE_ARCH .tar.gz
5659
5760
5861# 
@@ -163,7 +166,7 @@ STEP_DIR=$OBJ_GEN_INIT_CPIO
163166
164167if  [[ !  -f  $STEP_DIR  ]];  then 
165168  #  Delete previous initramfs and kernel
166-   rm -rf  $OUT_DIR 
169+   rmStep  $OUT_DIR   $PREBUILD 
167170
168171  (
169172    cd  $SRC_DIR /usr     && 
@@ -285,3 +288,15 @@ esac
285288ln -sfn $CPU  out/latest ||  err 90
286289
287290echo  -e " ${GRN} Successfully built 'barebones'${CLR} " 
291+ 
292+ 
293+ # 
294+ #  Pack Node.js in a node-gyp compatible way
295+ # 
296+ 
297+ #  TODO use Node.js arch instead of explicit CPUs and move to BigRedButton
298+ 
299+ STEP_DIR=$PREBUILD 
300+ 
301+ mkdir -p ` dirname $STEP_DIR ` && 
302+ tar -cf - out/$CPU  |  gzip >  $STEP_DIR  ||  err 100
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
3- rm -rf .vagga/ build/ out/ ||  exit  $? 
3+ rm -rf .vagga/ build/ out/ prebuilds/  ||  exit  $? 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments