Skip to content

Commit

Permalink
Release builds (#5)
Browse files Browse the repository at this point in the history
* Scripts to build releases

* Fix windows release script
  • Loading branch information
thiagoelg authored Sep 19, 2019
1 parent d9e4561 commit b9bd45d
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/*
releases/*
*~
.settings
.c9*
Expand Down
59 changes: 59 additions & 0 deletions tools/generateReleaseBuildsLinux.sh
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!"
63 changes: 63 additions & 0 deletions tools/generateReleaseBuildsWindows.ps1
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!"

0 comments on commit b9bd45d

Please sign in to comment.