WIP automatic release

This commit is contained in:
Antonin Descampe 2016-05-15 01:36:31 +02:00
parent d1ca2b4f29
commit d0babeb6f6
3 changed files with 41 additions and 23 deletions

View File

@ -4,10 +4,10 @@ matrix:
include: include:
- os: osx - os: osx
compiler: clang compiler: clang
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_DEPLOY=1 env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
- os: linux - os: linux
compiler: gcc compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_DEPLOY=1 env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
- os: linux - os: linux
compiler: gcc compiler: gcc
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
@ -67,7 +67,7 @@ script:
- ./tools/travis-ci/abi-check.sh - ./tools/travis-ci/abi-check.sh
before_deploy: before_deploy:
- export OPJ_RELEASE_PKG_FILE=$(ls *.zip) - export OPJ_RELEASE_PKG_FILE=$(ls build/openjpeg-${TRAVIS_TAG}*)
- echo "deploying $OPJ_RELEASE_PKG_FILE to GitHub releases" - echo "deploying $OPJ_RELEASE_PKG_FILE to GitHub releases"
deploy: deploy:
@ -80,4 +80,5 @@ deploy:
on: on:
repo: uclouvain/openjpeg repo: uclouvain/openjpeg
tags: true tags: true
condition: "$OPJ_CI_INCLUDE_IF_DEPLOY = 1"

View File

@ -8,10 +8,10 @@ environment:
matrix: matrix:
- OPJ_CI_ARCH: x86 - OPJ_CI_ARCH: x86
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS) OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
OPJ_CI_DEPLOY: 1 OPJ_CI_INCLUDE_IF_DEPLOY: 1
- OPJ_CI_ARCH: x64 - OPJ_CI_ARCH: x64
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS) OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
OPJ_CI_DEPLOY: 1 OPJ_CI_INCLUDE_IF_DEPLOY: 1
- OPJ_CI_ARCH: x86 - OPJ_CI_ARCH: x86
OPJ_CI_VSCOMNTOOLS: $(VS100COMNTOOLS) OPJ_CI_VSCOMNTOOLS: $(VS100COMNTOOLS)
install: install:
@ -25,14 +25,14 @@ test: off
#before_deploy: #before_deploy:
#- cmd: c:\cygwin\bin\bash ./tools/travis-ci/before_deploy.sh #- cmd: c:\cygwin\bin\bash ./tools/travis-ci/before_deploy.sh
deploy: deploy:
release: openjpeg-$(appveyor_repo_tag_name) #release: openjpeg-$(appveyor_repo_tag_name)
description: 'OpenJPEG $(appveyor_repo_tag_name) has been released' description: 'OpenJPEG $(appveyor_repo_tag_name) has been released. More info [here](https://github.com/uclouvain/openjpeg/blob/$(appveyor_repo_tag_name)/NEWS) and a detailed view [here](https://github.com/uclouvain/openjpeg/blob/$(appveyor_repo_tag_name)/CHANGES).'
provider: GitHub provider: GitHub
auth_token: auth_token:
secure: Huk03f1heCD/HMyA+4ZeVmICdmKn9rPxK5p8/KxzgL+FtJDHlqcllcCrtN9bDxRH # your encrypted token from GitHub secure: Huk03f1heCD/HMyA+4ZeVmICdmKn9rPxK5p8/KxzgL+FtJDHlqcllcCrtN9bDxRH # your encrypted token from GitHub
artifact: /.*\.zip/ # upload all zip packages to release assets artifact: /.*\.zip/ # upload all zip packages to release assets
draft: true draft: false
prerelease: false prerelease: false
on: on:
branch: openjpeg-*
appveyor_repo_tag: true # deploy on tag push only appveyor_repo_tag: true # deploy on tag push only
OPJ_CI_INCLUDE_IF_DEPLOY: 1

View File

@ -189,6 +189,37 @@ ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V || true
# ignore ctest exit code & parse this ourselves # ignore ctest exit code & parse this ourselves
set +x set +x
# Deployment if needed
#---------------------
if [ "${TRAVIS_TAG:-}" != "" ]; then
OPJ_TAG_NAME=${TRAVIS_TAG}
elif [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
OPJ_TAG_NAME=${APPVEYOR_REPO_TAG_NAME}
else
OPJ_TAG_NAME=""
fi
if [ "${OPJ_CI_INCLUDE_IF_DEPLOY:-}" == "1" ] && [ "${OPJ_TAG_NAME:-}" != "" ]; then
#if [ "${OPJ_CI_INCLUDE_IF_DEPLOY:-}" == "1" ]; then
OPJ_CI_DEPLOY=1 # unused for now
OPJ_CUR_DIR=${PWD}
if [ "${TRAVIS_OS_NAME:-}" == "linux" ]; then
OPJ_PACK_GENERATOR="TGZ" # ZIP generator currently segfaults on linux
else
OPJ_PACK_GENERATOR="ZIP"
fi
OPJ_PACK_NAME="openjpeg-${OPJ_TAG_NAME}-${TRAVIS_OS_NAME}-${OPJ_CI_ARCH}"
cd ${OPJ_BINARY_DIR}
cmake -D CPACK_GENERATOR:STRING=${OPJ_PACK_GENERATOR} -D CPACK_PACKAGE_FILE_NAME:STRING=${OPJ_PACK_NAME} ${OPJ_SOURCE_DIR}
cd ${OPJ_CUR_DIR}
cmake --build ${OPJ_BINARY_DIR} --target package
echo "ready to deploy $(ls ${OPJ_BINARY_DIR}/${OPJ_PACK_NAME}*) to GitHub releases"
if [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
appveyor PushArtifact "${OPJ_BINARY_DIR}/${OPJ_PACK_NAME}.zip"
fi
else
OPJ_CI_DEPLOY=0
fi
# let's parse configure/build/tests for failure # let's parse configure/build/tests for failure
echo " echo "
@ -272,18 +303,4 @@ New/unknown test failure found!!!
fi fi
fi fi
echo "OPJ_CI_DEPLOY: ${OPJ_CI_DEPLOY:-}"
echo "TRAVIS_TAG: ${TRAVIS_TAG:-}"
echo "APPVEYOR_REPO_TAG: ${APPVEYOR_REPO_TAG:-}"
echo "APPVEYOR_REPO_TAG_NAME: ${APPVEYOR_REPO_TAG_NAME:-}"
if [ "${OPJ_CI_DEPLOY:-}" == "1" ]; then
if [ "${TRAVIS_TAG:-}" != "" ]; then
cpack -G ZIP -P "OpenJPEG-${TRAVIS_TAG}-${OPJ_BUILDNAME_TEST}.zip"
fi
if [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
cpack -G ZIP -P "OpenJPEG-${APPVEYOR_REPO_TAG_NAME}-${OPJ_BUILDNAME_TEST}.zip"
appveyor PushArtifact "OpenJPEG-${APPVEYOR_REPO_TAG_NAME}-${OPJ_BUILDNAME_TEST}.zip"
fi
fi
exit ${OPJ_CI_RESULT} exit ${OPJ_CI_RESULT}