diff --git a/.travis.yml b/.travis.yml index f82e83c7..060a1d03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ install: script: - ./scripts/ci/travis-test.sh + - ./scripts/ci/travis-build-installers.sh deploy: provider: script diff --git a/Makefile b/Makefile index b3c85ad1..ad77451e 100644 --- a/Makefile +++ b/Makefile @@ -156,6 +156,8 @@ TARGET_ARCH_DEBIAN = $(shell ./scripts/build/architecture-convert.sh -r $(TARGET PRODUCT_NAME = etcher APPLICATION_NAME_LOWERCASE = $(shell echo $(APPLICATION_NAME) | tr A-Z a-z) APPLICATION_VERSION_DEBIAN = $(shell echo $(APPLICATION_VERSION) | tr "-" "~") + +# Fix hard link Appveyor issues CPRF = cp -RLf # --------------------------------------------------------------------- @@ -430,6 +432,7 @@ TARGETS = \ package-electron \ package-cli \ cli-develop \ + installers-all \ electron-develop package-electron: $(BUILD_DIRECTORY)/$(APPLICATION_NAME)-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH) @@ -478,6 +481,8 @@ PUBLISH_AWS_S3 += \ $(BUILD_OUTPUT_DIRECTORY)/$(APPLICATION_NAME)-cli-$(APPLICATION_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH).zip endif +installers-all: $(PUBLISH_AWS_S3) $(PUBLISH_BINTRAY_DEBIAN) + ifdef PUBLISH_AWS_S3 publish-aws-s3: $(PUBLISH_AWS_S3) ifeq ($(RELEASE_TYPE),production) diff --git a/appveyor.yml b/appveyor.yml index 7976c1c8..84366b5b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,10 +35,11 @@ build: off test_script: - node --version - npm --version - - cmd: .\scripts\ci\appveyor-test.bat + - .\scripts\ci\appveyor-test.bat + - .\scripts\ci\appveyor-build-installers.bat deploy_script: - - cmd: .\scripts\ci\appveyor-deploy.bat + - .\scripts\ci\appveyor-deploy.bat notifications: diff --git a/scripts/ci/appveyor-build-installers.bat b/scripts/ci/appveyor-build-installers.bat new file mode 100755 index 00000000..c7fcd252 --- /dev/null +++ b/scripts/ci/appveyor-build-installers.bat @@ -0,0 +1,24 @@ +@echo off + +:: Copyright 2017 resin.io +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. + +IF "%APPVEYOR_REPO_BRANCH%"=="" ( + ECHO This script is only meant to run in Appveyor CI 1>&2 + EXIT /B 1 +) + +call make installers-all || ( EXIT /B 1 ) + +EXIT /B %ERRORLEVEL% diff --git a/scripts/ci/travis-build-installers.sh b/scripts/ci/travis-build-installers.sh new file mode 100755 index 00000000..a27af4fa --- /dev/null +++ b/scripts/ci/travis-build-installers.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +### +# Copyright 2017 resin.io +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +### + +set -e +set -u + +if [ -z "$TRAVIS_OS_NAME" ]; then + echo "This script is only meant to run in Travis CI" 1>&2 + exit 1 +fi + +./scripts/build/check-dependency.sh make + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + ./scripts/build/docker/run-command.sh \ + -r "$TARGET_ARCH" \ + -s "$(pwd)" \ + -c 'make installers-all' +else + make installers-all +fi diff --git a/scripts/ci/travis-test.sh b/scripts/ci/travis-test.sh index 22aa732d..320c92f1 100755 --- a/scripts/ci/travis-test.sh +++ b/scripts/ci/travis-test.sh @@ -24,6 +24,9 @@ if [ -z "$TRAVIS_OS_NAME" ]; then exit 1 fi +./scripts/build/check-dependency.sh npm +./scripts/build/check-dependency.sh make + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/build/docker/run-command.sh \ -r "$TARGET_ARCH" \