forked from tojocky/node-printer
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Scripts to build releases * Fix windows release script
- Loading branch information
Showing
3 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build/* | ||
releases/* | ||
*~ | ||
.settings | ||
.c9* | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
RELEASE_VERSION=$1 | ||
PACKAGE_VERSION=$(node -pe "require('./package.json').version") | ||
SOURCE_PATH="${BASH_SOURCE%/*}/.." | ||
|
||
declare -a node_versions=( | ||
"0.10.48" | ||
"0.12.18" | ||
"4.9.1" | ||
"5.9.1" | ||
"6.17.1" | ||
"8.16.1" | ||
"10.16.0" | ||
"11.15.0" | ||
"12.10.0" | ||
) | ||
|
||
declare -a electron_versions=( | ||
"1.2.8" | ||
"1.3.8" | ||
"1.4.6" | ||
"1.7.12" | ||
"2.0.18" | ||
"3.1.13" | ||
"4.2.10" | ||
"5.0.10" | ||
"6.0.7" | ||
) | ||
|
||
# remove old build directory | ||
rm -rf "$SOURCHE_PATH/build" > /dev/null | ||
|
||
# create release path | ||
mkdir -p "$SOURCE_PATH/releases/$RELEASE_VERSION" > /dev/null | ||
|
||
for version in "${node_versions[@]}" | ||
do | ||
echo "Building for node version: $version..." | ||
node-pre-gyp configure --target=$version --module_name=node_printer --silent | ||
node-pre-gyp build package --target=$version --target_arch=x64 --build-from-source --silent | ||
node-pre-gyp configure --target=$version --module_name=node_printer --silent | ||
node-pre-gyp build package --target=$version --target_arch=ia32 --build-from-source --silent | ||
rsync -a -v "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files > /dev/null | ||
echo "Done" | ||
done | ||
|
||
for version in "${electron_versions[@]}" | ||
do | ||
echo "Building for electron version: $version..." | ||
node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | ||
node-pre-gyp build package --target=$version --target_arch=x64 --runtime=electron --build-from-source --silent | ||
node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | ||
node-pre-gyp build package --target=$version --target_arch=ia32 --runtime=electron --build-from-source --silent | ||
rsync -a -v "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files > /dev/null | ||
echo "Done" | ||
done | ||
|
||
echo "Finished succesfully!" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
param ( | ||
[Parameter(Mandatory=$true)][string]$release | ||
) | ||
|
||
$SOURCE_PATH = split-path -parent $MyInvocation.MyCommand.Definition | ||
$RELEASE_VERSION = $release | ||
$PACKAGE_VERSION = node -pe "require('./package.json').version" | ||
|
||
echo $SOURCE_PATH | ||
|
||
$node_versions = @( | ||
"0.10.48", | ||
"0.12.18", | ||
"4.9.1", | ||
"5.9.1", | ||
"6.17.1", | ||
"8.16.1", | ||
"10.16.0", | ||
"11.15.0", | ||
"12.10.0" | ||
) | ||
|
||
$electron_versions = @( | ||
"1.2.8", | ||
"1.3.8", | ||
"1.4.6", | ||
"1.7.12", | ||
"2.0.18", | ||
"3.1.13", | ||
"4.2.10", | ||
"5.0.10", | ||
"6.0.7" | ||
) | ||
|
||
# remove old build directory | ||
Remove-Item -Recurse -Force $SOURCE_PATH'\..\build' -ErrorAction Ignore | Out-Null | ||
|
||
# create release path | ||
New-Item $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ItemType Directory -ea 0 | Out-Null | ||
|
||
foreach ($version in $node_versions) { | ||
Write-Output "Building for node version: $version..." | ||
node-pre-gyp configure --target=$version --module_name=node_printer --silent | Out-Null | ||
node-pre-gyp build package --target=$version --target_arch=x64 --build-from-source --silent | Out-Null | ||
node-pre-gyp configure --target=$version --module_name=node_printer --silent | Out-Null | ||
node-pre-gyp build package --target=$version --target_arch=ia32 --build-from-source --silent | Out-Null | ||
Copy-item -Force -Recurse $SOURCE_PATH'\..\build\stage\'$PACKAGE_VERSION\* -Destination $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ErrorAction Ignore | Out-Null | ||
Remove-Item -Recurse -Force $SOURCE_PATH'\..\build\stage' | Out-Null | ||
Write-Output "Done" | ||
} | ||
|
||
foreach ($version in $electron_versions) { | ||
Write-Output "Building for electron version: $version..." | ||
node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | Out-Null | ||
node-pre-gyp build package --target=$version --target_arch=x64 --runtime=electron --build-from-source --silent | Out-Null | ||
node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | Out-Null | ||
node-pre-gyp build package --target=$version --target_arch=ia32 --runtime=electron --build-from-source --silent | Out-Null | ||
Copy-item -Force -Recurse $SOURCE_PATH'\..\build\stage\'$PACKAGE_VERSION\* -Destination $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ErrorAction Ignore | Out-Null | ||
Remove-Item -Recurse -Force $SOURCE_PATH'\..\build\stage' | Out-Null | ||
Write-Output "Done" | ||
} | ||
|
||
Write-Output "Finished succesfully!" |