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 18, 2019
1 parent df25931 commit b74be5c
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 44 deletions.
62 changes: 32 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,30 @@ jobs:
- 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/

# - 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 ~/$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,13 +99,16 @@ 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:
Expand All @@ -118,18 +123,15 @@ 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_glob: true
file: ~/$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:
- ./tools/aws_tasks.sh synchronize
61 changes: 49 additions & 12 deletions tools/aws_tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,66 @@
# It enables travis jobs to store builds on S3 for release packaging

function setup {
mkdir -p ~/.aws
x_aws_credentials
x_aws_install

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

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

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

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

if [[ ( "$TRAVIS_PULL_REQUEST" == false ) && ( "$TRAVIS_BRANCH" == "develop" ) && ( "$TRAVIS_REPO_SLUG" == "KjellMorgenstern/fritzing-app" )]]; then
echo "Running deploy task '$1'"
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 ) ]]; then
x_aws_env
#&& ( "$TRAVIS_BRANCH" == "develop" )
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 b74be5c

Please sign in to comment.