Skip to content

Commit

Permalink
Add MacOS CD build to release
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellMorgenstern committed Jun 20, 2019
1 parent 18dd47a commit d57fa8b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 53 deletions.
77 changes: 40 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stages:
env:
global:
# include $HOME/.local/bin for `aws`
- PATH=$HOME/.local/bin:$PATH
# - PATH=$HOME/.local/bin:$PATH
- secure: "fn3QWEi/PPcq4CGAVqlWauFn6/yVnb7MtBVWAkcrMDGSty1OdTkXt9LrBLcrnYKMsonxauJJSA3grx0mDqUZ+5vR7TjO3Cg7lcXuMZe/pdWia3DDJ4+Rl/Lw8viCD2rczNzI8E9R/FHBRhepx3T9n4wDQKv5ozoVyqw/4iZaJ+DMxqYRng3o6f541gsYBl6QNIe0ZcGmsy6izaD94IfNemHNS31HOqXtJeVAhwBo59jx/tk1KrMo724s7tr++bkzAJH04T4UlHKKJe/aJpxf592ZEIbahjOk3AwbB6HAr9Nh9ZiQKZW2BYE3S1Me/laZ42bF4+c6HcIlor/UY6WQsjdEoL+MULg0BdSQxuhd/Gc3VIp9pupQM8B+soshOTfLTKVj4nK/gOQxfsoHY4HZXHBAvKnxyOGC7PXwh/hiPdRDKRtWcCwUqY4joo0zd0Mn9Tno7Q4TOfDxWMsiqRyJ6VoDndrLlBqu4USkoLY3mhN2BfXHekCX1G+f4HErOiQDxTPp3GY7o3uAwp0r4Pj+qsGsDeou2cxdFgPexlWQc2NNAfqPoA42TORWV4xqLkNzyWhE6946dC5NUM4sAy3wHShwEUaW0WT/WUoFvDH0VQPSdH2sLjxkx7m+vnkHa4H31JfOUigR3DgZ8MlZFFmJIKPH37F2fb4x7m1d1uwciEg="
- secure: "K2cy5+vb/BbWz92nCDacFwe3chy62qqegNcmwk+69JCuGKDtHiWaEsukm2arp/OiTcwXJgZjw35NhUrbIXzYtIaegc+4ImXOpMsGeOwxPruzNt+a+Yp9uAECs6fs+tI75RrGmVjVZZCx2J4cAYrjYAqLt7wvv9liB4PE+sOZZmzMLBJ1mC5JI1hN5qyRR18Q2xnTcTVfMciEpW3QtpGRSlecdQUUSXryDLTRo4OCgYNpWMDoX5q5XfMqPKkfjcjXuAvJfKjvWD64etSEUguC64/cEUiOsW6culvZimNSlF5Lv5MkrBmrEYCW677MT/R/eIllaaATmuFqoeQ3Dw1Pc2j49PL8pQisggA/tSRt/csUyoPouPEezD4uZitj+oSWX6qOl1sV+AV2Pd/ApR9YRRNXm8Z/bp0ZqobBt5ev5pM9eoDL9qoypGWR5RdLcOwhpiGt5EzhhhW7/oDOR+XD43WK6Rv776jW1RTAMwQuEf8uL62c7HNcBjhNO3sovd4RKnGp6jNz5NTB10T2F2RvapSNJLIuhZjb2MjCGhjD4p6cJdEL84hBcQkGO9aJP4G1oT7y8sCfLTWwvH4xUSIH9X2joMNQMu+Dni9QmH5j9d2iakwo4k1SocCbTkfy1CPwNKLCn81t/mMtXKKgIDJZ3b1SC/ljCAvGRHgvUmIhVdg="

Expand All @@ -28,35 +28,37 @@ jobs:
services:
- docker
before_install:
- mkdir -p ~/$TRAVIS_BUILD_NUMBER
- mkdir -p "$HOME/$TRAVIS_BUILD_NUMBER"
- ./tools/aws_tasks.sh setup
- docker pull fritzing/build:xenial
script:
- docker/release-linux.sh $TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER
- cp fritzing-"$TRAVIS_COMMIT"-debug-continuous-$TRAVIS_BUILD_NUMBER.linux.AMD64.tar.bz2 ~/$TRAVIS_BUILD_NUMBER/
- cp fritzing-"$TRAVIS_COMMIT"-debug-continuous-$TRAVIS_BUILD_NUMBER.linux.AMD64.tar.bz2 "$HOME/$TRAVIS_BUILD_NUMBER/"

# - stage: build_and_pack
# os: osx
# language: cpp
# osx_image: xcode10.2
# cache:
# directories:
# ../libgit2/build

# addons:
# homebrew:
# packages:
# - qt5
- stage: build_and_pack
os: osx
language: cpp
osx_image: xcode10.2
cache:
directories:
../libgit2/build

addons:
homebrew:
packages:
- qt5

# before_install:
# - mkdir -p ../libgit2/build
# - wget -q -O - https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz | tar xz && mv libgit2-0.28.1/* ../libgit2/
# - (cd ../libgit2/build && cmake -D BUILD_SHARED_LIBS=OFF .. && cmake --build .)
# - (cd src/lib && wget -q -O - https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj)
# - xcrun -sdk macosx --show-sdk-path
# script:
# - tools/deploy_fritzing_mac.sh
# - echo one | tee > ~/$TRAVIS_BUILD_NUMBER/two
before_install:
- mkdir -p ../libgit2/build
- wget -q -O - https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz | tar xz && mv libgit2-0.28.1/* ../libgit2/
- (cd ../libgit2/build && cmake -D BUILD_SHARED_LIBS=OFF .. && cmake --build .)
- (cd src/lib && wget -q -O - https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj)
- xcrun -sdk macosx --show-sdk-path
- mkdir -p "$HOME/$TRAVIS_BUILD_NUMBER"
- ./tools/aws_tasks.sh setup
script:
- tools/deploy_fritzing_mac.sh
- cp ../deploy-app/Fritzing.dmg ~/$TRAVIS_BUILD_NUMBER/Fritzing-"$TRAVIS_COMMIT"-debug-continuous-$TRAVIS_BUILD_NUMBER.10.2.dmg

# - os: osx
# language: objective-c
Expand All @@ -80,8 +82,8 @@ jobs:
# - tools/deploy_fritzing_mac.sh
# - echo one | tee > ~/$TRAVIS_BUILD_NUMBER/three

# # Fails. We did not find a good way to start a developer command prompt yet.
# - os: windows
# - stage: build_and_pack
# os: windows
# language: cpp
# env:
# # - NMAKE_PATH="/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/"
Expand All @@ -97,19 +99,22 @@ jobs:
# - curl -fsSL https://github.com/libgit2/libgit2/archive/v0.28.1.zip -o libgit2.zip && 7z x libgit2.zip && mv libgit2-0.28.1 ../libgit2
# - (mkdir ../libgit2/build64 && cd ../libgit2/build64 && cmake -G "Visual Studio 15 2017 Win64" .. && cmake --build . --config Release)
# - (cd src/lib && curl -L https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj)
# - mkdir -p ~/$TRAVIS_BUILD_NUMBER
# - ./tools/aws_tasks.sh setup

# script:
# - tools/build-windows.bat
# - tools/build-windows.bat "$TRAVIS_COMMIT"-debug-continuous-"$TRAVIS_BUILD_NUMBER"
# # - /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/Common7/Tools/VsDevCmd.bat
# # - cat /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars64.bat
# # - tools/release_fritzing.bat 0.9.4b 64 2017
# # - export PATH="$NMAKE_PATH:$RC_PATH:$PATH"
# - cp ..\release*\* ~/$TRAVIS_BUILD_NUMBER

- stage: deploy_to_github
before_install:
- mkdir -p ~/$TRAVIS_BUILD_NUMBER
- mkdir -p "$HOME/$TRAVIS_BUILD_NUMBER"
- ./tools/aws_tasks.sh setup

- ./tools/aws_tasks.sh synchronize_down
before_deploy:
- git config --local user.name "Travis C.D."
- git config --local user.email "travis@fritzing.org"
Expand All @@ -118,18 +123,16 @@ jobs:
provider: releases
api_key:
secure: mC16qH9Jp5a82bhSYwR/AmDFnJpY7XffXzUhQkXXfgRvjmVDrfjTr0/LaQpOb3EWzjA1LbiVdm/9GhJZJ2Sj/Nsawn+anIaJ1mVt4839SsWCC4MsNfvQBawWnug0HXyjCmymNRbtCz38WmONPL0fQaHbC+eAADrpUzqM1jC/Zs7mCkWKNFGwXD4ekbxTNGmhbAbv/yjqC5rapjcMRpGUlIBUqwylYCck59CW4CR3LKI85USLsQMn/vL18jnMucHRfdHcGz2u4SNwYB6H+KKc8J2hCeKhQQbiAbHeN4SAb3ycWW1/hyoP0s7sHnOrMzJsUtKehP9HDfOoHjC1QDT894l8PJMqiLpKVYjP9wYfuTs/1MvAaIOVl6dJuuAlVFVDDno9UDmyHhbqyYDdYuZacqLLdoIHW6kqAmFekf1Ey6Nn7y0MR8g3+G8/R+NOwpnu/O68iYVHvYYDCubss6Ye6VjvTlvXAg/DOtrnDyLjzjATek1K25wN9R5WnFQzkHqELtCMouAq4AtdZquqH89tLlkbaolDuXStstDDFukla0+FcI+Hj5xcwxqae2cwyCgO2wJNgGSDZb7gsRPp0LkYhAtS7I7PvbxsGNxnAq1HlVyEAB5C5S+de1l2dgkXVBE74lo7mj9kA1McYQfvPp8uCt9AWJ5JnAngvGQt05Hi+mw=
file_glob: true
script:
- ls
- ls ~/$TRAVIS_BUILD_NUMBER
file: ~/$TRAVIS_BUILD_NUMBER/*
file_glob: true
file: $HOME/$TRAVIS_BUILD_NUMBER/*
on:
repo: KjellMorgenstern/fritzing-app
branch: develop
skip_cleanup: true

after_deploy:
- ./tools/aws_tasks.sh cleanup
# after_deploy:
# - ./tools/aws_tasks.sh cleanup
#after_success:

after_success:
- ./tools/aws_tasks.sh synchronize
- ./tools/aws_tasks.sh synchronize_up
62 changes: 48 additions & 14 deletions tools/aws_tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,63 @@
# It enables travis jobs to store builds on S3 for release packaging

function setup {
mkdir -p ~/.aws

cat > ~/.aws/credentials << EOL
[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
EOL
x_aws_credentials
x_aws_install
}

# set up awscli packages
pip install --user awscli
mkdir -p ~/"$TRAVIS_BUILD_NUMBER"
aws s3 sync s3://fritzing/"$TRAVIS_BUILD_NUMBER" ~/"$TRAVIS_BUILD_NUMBER"
function synchronize_down {
aws s3 sync s3://fritzing/"$TRAVIS_BUILD_NUMBER" "$HOME/$TRAVIS_BUILD_NUMBER"
}

function synchronize {
aws s3 sync ~/"$TRAVIS_BUILD_NUMBER" s3://fritzing/"$TRAVIS_BUILD_NUMBER"
function synchronize_up {
aws s3 sync "$HOME/$TRAVIS_BUILD_NUMBER" s3://fritzing/"$TRAVIS_BUILD_NUMBER"
}

function cleanup {
aws s3 rm --recursive s3://fritzing/"$TRAVIS_BUILD_NUMBER" # clean up after ourselves
}

function x_aws_install {
case "$TRAVIS_OS_NAME" in
linux*)
pip install --user awscli
;;
osx*)
pip3 install --user awscli
;;
windows*)
choco install awscli
# type "C:/ProgramData/chocolatey/logs/chocolatey.log"
;;
esac
}

function x_aws_env {
case "$TRAVIS_OS_NAME" in
linux*)
export PATH=$HOME/.local/bin:$PATH
;;
osx*)
export PATH=$HOME/Library/Python/3.7/bin:$PATH
;;
windows*)
export PATH="$PATH:$USERPROFILE/AppData/Local/Programs/Python/Python37/Scripts:C:/Program Files (x86)/Amazon/AWSCLI\bin"
;;
esac
}

function x_aws_credentials {
mkdir -p "$HOME"/.aws
cat > "$HOME"/.aws/credentials << EOL
[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
EOL
}

if [[ ( "$TRAVIS_PULL_REQUEST" == false ) && ( "$TRAVIS_BRANCH" == "develop" ) && ( "$TRAVIS_REPO_SLUG" == "KjellMorgenstern/fritzing-app" )]]; then
echo "Running deploy task '$1'"
x_aws_env

echo "Running deploy task '$1' on $TRAVIS_OS_NAME ( $OSTYPE )"
$1;
fi
2 changes: 1 addition & 1 deletion tools/build-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ REM echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -test

tools\release_fritzing.bat 0.9.4b 64 2017
tools\release_fritzing.bat %1 64 2017
3 changes: 2 additions & 1 deletion tools/deploy_fritzing_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
QTBIN=/usr/local/opt/qt5/bin

# Go to this scripts directory and then one up
cd "$(dirname "$(realpath "$0")")";
toolsdir=$(dirname "${BASH_SOURCE[0]}")
cd "$toolsdir"/..
workingdir=$(pwd)

echo ">> working directory"
Expand Down

0 comments on commit d57fa8b

Please sign in to comment.