Skip to content

Commit

Permalink
Merge pull request #145 from ccheraa/master
Browse files Browse the repository at this point in the history
Upload prebuilt binaries
  • Loading branch information
duncdrum authored Sep 30, 2021
2 parents 6f3eca3 + 4b938ab commit c4958d7
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ jobs:
- run:
command: yarn package
no_output_timeout: 15m
- run:
name: add server to known hosts
command: |
mkdir -p ~/.ssh
ssh-keyscan static.evolvedbinary.com >> ~/.ssh/known_hosts
- add_ssh_keys:
fingerprints:
- "3b:f6:39:ee:37:d3:5a:3f:c5:cd:45:9c:15:6a:44:36"
- run:
name: Uploading prebuilt binaries
command: ./upload-prebuilt-binaries.sh
# Artifacts
- unless:
condition:
Expand Down Expand Up @@ -103,6 +114,23 @@ jobs:
- run: node --version
- run: yarn --version
- run: yarn package
- run:
name: Install latest version of OpenSSH
command: |
choco install openssh
echo 'export PATH=$(echo $PATH | sed '"'"'s/\\/c\\/Windows\\/System32\\/OpenSSH/\\/c\\/Program\\ Files\\/OpenSSH-Win64\\/ssh/g'"'"')' >> $BASH_ENV
source $BASH_ENV
- run:
name: add server to known hosts
command: |
mkdir -p ~/.ssh
ssh-keyscan static.evolvedbinary.com >> ~/.ssh/known_hosts
- add_ssh_keys:
fingerprints:
- "3b:f6:39:ee:37:d3:5a:3f:c5:cd:45:9c:15:6a:44:36"
- run:
name: Uploading prebuilt binaries
command: ./upload-prebuilt-binaries.sh win
- store_artifacts:
path: dist/fusion-studio-2.0.0-next.0-installer.exe
destination: Windows
Expand Down
12 changes: 6 additions & 6 deletions docker/centos7_x64/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# !/bin/sh
source /root/.bashrc
source scl_source enable devtoolset-8
yarn config set drivelist_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/drivelist
yarn config set @theia/node-pty_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/node-pty
yarn config set find-git-repositories_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/find-git-repositories
yarn config set native-keymap_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/native-keymap
yarn config set nsfw_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/nsfw
yarn config set oniguruma_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/oniguruma
export npm_config_drivelist_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/drivelist
export npm_config__theia_node_pty_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/node-pty
export npm_config_find_git_repositories_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/find-git-repositories
export npm_config_native_keymap_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/native-keymap
export npm_config_nsfw_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/nsfw
export npm_config_oniguruma_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/oniguruma
cp /root/force-download.js /project
cd /project
if [ -d /project/node_modules ]; then
Expand Down
85 changes: 85 additions & 0 deletions upload-prebuilt-binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# !/bin/bash
abi=80
user=ccheraa
ignoredbinaries="ffmpeg conpty_console_list conpty"
server=static.evolvedbinary.com
basedir=/www-data/static.evolvedbinary.com/fusion-studio-bin
os=$1
function ignored {
[[ $ignoredbinaries =~ (^|[[:space:]])$1($|[[:space:]]) ]]
}
function upload {
echo processing $1:
[[ $1 =~ .*/build/Release/(.*).node ]]
file=${BASH_REMATCH[1]}
ignored $file
if [[ $? == "0" ]]; then
echo "package in ignore list, skipped."
else
[[ $1 =~ node_modules/([^/]+/)*([^/]+)/build/Release/(.*).node ]]
pkgpath=${BASH_REMATCH[1]}
pkg=${BASH_REMATCH[2]}
pkgjson=node_modules/$pkgpath$pkg/package.json
pkgversion=$(cat $pkgjson | grep '"version"' | sed 's/.*"version".*"\(.*\)".*/\1/')
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
platform=linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
platform=darwin
else
platform=win32
fi
tar=$pkg-v$pkgversion-electron-v$abi-$platform-x64.tar.gz;
dir=$pkg/v$pkgversion;
tardir=$basedir/$dir;
tarpath=$tardir/$tar;
ssh $user@$server "[[ -f $tarpath ]];"
if [[ $? == "0" ]]; then
echo $pkg@$pkgversion found, no need to re-upload.
else
printf "$pkg@$pkgversion not found. uploading...\n"
tmp=/tmp/$tar
mkdir -p $tmp/build/Release
cp $1 $tmp/build/Release
tar -czf $tmp/$tar --directory=$tmp build > /dev/null
ssh $user@$server "mkdir -p \"$tardir\""
scp -q $tmp/$tar $user@$server:$tardir
rm -rf $tmp
fi
fi
}
function list {
if [[ "$os" == "win" ]]; then
ls -R node_modules | {
while IFS= read -r filename
do
if [[ "$filename" =~ (.*):$ ]]; then
dir=${BASH_REMATCH[1]}
else
if [[ "$filename" != "" ]]; then
echo "$dir/$filename"
fi
fi
done
} | grep /build/Release | grep .node | {
while IFS= read -r path
do
if [[ $path =~ $root/(.*)/build/Release/([^/]*).node ]] && [[ ${BASH_REMATCH[2]} != ffmpeg ]]; then
echo "$path"
fi
done
} | {
while IFS= read -r path
do
echo "$path"
done
}
else
find node_modules -wholename "*/build/Release/*.node" -exec bash -c '[[ $(dirname $1) == *build/Release ]] && [[ $1 =~ node_modules/(.*)/build/Release/(.*).node ]] && echo $1' bash {} \;
fi
}
l=$(list)
for x in $l
do
upload $x
done
echo done!

0 comments on commit c4958d7

Please sign in to comment.