travis > github
This commit is contained in:
Родитель
120abf425c
Коммит
d3542dad34
|
@ -0,0 +1,81 @@
|
|||
name: ci
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# build-os: [ amd64-ubuntu, amd64-centos, armv7-raspbian, aarch64-ubuntu ]
|
||||
build-os: [ amd64-ubuntu, amd64-centos ]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
platform: linux
|
||||
env:
|
||||
BUILD_OS: ${{ matrix.build-os }}
|
||||
|
||||
name: CI
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup
|
||||
shell: bash
|
||||
run: |
|
||||
git submodule update --init --recursive --depth 1
|
||||
sudo apt update && sudo apt install -y autoconf-archive libssl-dev libwrap0-dev
|
||||
|
||||
- name: Download CryptoPro CSP
|
||||
env:
|
||||
CPRO_CREDENTIALS: ${{ secrets.CPRO_CREDENTIALS }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$BUILD_OS" == "amd64-ubuntu" ]; then
|
||||
curl https://${CPRO_CREDENTIALS}@update.cryptopro.ru/support/stunnel/dist/csp50r2/linux-amd64_deb.tgz --output linux-amd64_deb.tgz
|
||||
tar -xvf linux-amd64_deb.tgz
|
||||
elif [ "$BUILD_OS" == "amd64-centos" ]; then
|
||||
curl https://${CPRO_CREDENTIALS}@update.cryptopro.ru/support/stunnel/dist/csp50r2/linux-amd64.tgz --output linux-amd64.tgz
|
||||
tar -xvf linux-amd64.tgz
|
||||
elif [ "$BUILD_OS" == "armv7-raspbian" ]; then
|
||||
curl https://${CPRO_CREDENTIALS}@update.cryptopro.ru/support/stunnel/dist/csp50r2/linux-armhf_deb.tgz --output linux-armhf_deb.tgz
|
||||
tar -xvf linux-armhf_deb.tgz
|
||||
elif [ "$BUILD_OS" == "aarch64-ubuntu" ]; then
|
||||
curl https://${CPRO_CREDENTIALS}@update.cryptopro.ru/support/stunnel/dist/csp50r2/linux-arm64_deb.tgz --output linux-arm64_deb.tgz
|
||||
tar -xvf linux-arm64_deb.tgz
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Build
|
||||
id: build
|
||||
env:
|
||||
MSSPI: yes
|
||||
CONFIGURE_OPTIONS: --with-threads=pthread --enable-msspi
|
||||
CSPMODE: kc1
|
||||
run: |
|
||||
if [ "$BUILD_OS" == "amd64-ubuntu" ]; then
|
||||
export ARCH='amd64'
|
||||
export ARCH_DIST='linux-amd64'
|
||||
bash -ex ./build_amd64.sh
|
||||
elif [ "$BUILD_OS" == "amd64-centos" ]; then
|
||||
export ARCH='amd64'
|
||||
export ARCH_DIST='linux-amd64'
|
||||
bash -ex ./build_amd64_centos.sh
|
||||
elif [ "$BUILD_OS" == "armv7-raspbian" ]; then
|
||||
export ARCH='armv7'
|
||||
export ARCH_DIST='linux-armhf'
|
||||
bash -ex ./build_armv7.sh
|
||||
elif [ "$BUILD_OS" == "aarch64-ubuntu" ]; then
|
||||
export ARCH='aarch64'
|
||||
export ARCH_DIST='linux-arm64'
|
||||
bash -ex ./build_arm64.sh
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
echo ::set-output name=VERSION::${GITHUB_REF#refs/*/}-${BUILD_OS}
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: src/${{ steps.build.outputs.VERSION }}.tar.gz
|
79
.travis.yml
79
.travis.yml
|
@ -1,79 +0,0 @@
|
|||
sudo: enabled
|
||||
|
||||
|
||||
dist: xenial
|
||||
|
||||
branches:
|
||||
only:
|
||||
- /.*/
|
||||
|
||||
language: c
|
||||
|
||||
os:
|
||||
- linux
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
before install:
|
||||
- sudo apt-get -qq update
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: twdfThD5M6bIeGTGiS7vsUUtYpUOHobh13n/s0Q1aiSbAgZ9WMrXZ+b0UJzuB12NrqT64IlfR8qdv023Arf+bMtVuiK1GfF8AGk2ntIFE7deF/D4Ba8JzKIAL/rRB3ensEJXlXIdxoGVMr5j1oEljl5qsAJLay0cQZfAZBN+1hxZ2ONGbuejPRTjLUxPtdl3oIt1VR4qZG/GOONc3lXPgrvNQvwuVfpHZmp+raTyuQgm4l00mgEbYNm9zbSbRYYAA1sQQBSt0QisUa4SJ5e47/GBVMnAOOwo3huAxex1zQ+8FJVrWOc/1E7X8cL5EYxNM5CqSa3Yc3q3lOWtSuVUvDZ0K9G2VpkB5oWGYDnqZLxbOA70+6wjRVIFMJ56dG9pEL9ofyPtDDQOO34hXso1WIa1oh41520xDCprB/g0BMwJrZQJ3mui5j7Kub5HPujq/lsas7CUEQoaOILaFGerLXnh3J+3JwYN83cPA6av4RSouFfH6X0GBnv6ZGCWFYBOqXBWNrKGIFFzJ/AOxbjB82jbeOD2tsB3vY4md9lcSBXpoS7uhbKrBw4JWMSm9sR2sDudsM2fZXh155Uv8GHcsChPoibkw/71ZSm/y9z6qGAwmaYz3bCX74cN9YhSGIG1UqMS4BbWnjALaQajqSSAtIF8qnwnuTEFgVmsq2+skBQ=
|
||||
matrix:
|
||||
- ARCH='armv7' ARCH_DIST='linux-armhf' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
|
||||
- ARCH='aarch64' ARCH_DIST='linux-arm64' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
|
||||
- ARCH='amd64' ARCH_DIST='linux-amd64' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
|
||||
- ARCH='amd64' ARCH_DIST='linux-amd64' BUILD_OS='centos' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- autoconf-archive
|
||||
- libssl-dev
|
||||
- libwrap0-dev
|
||||
- g++-4.9
|
||||
|
||||
install:
|
||||
- if [ "$MSSPI" = "yes" ]; then
|
||||
if [ "$BUILD_OS" = "centos" ]; then
|
||||
wget https://$ACCOUNT@update.cryptopro.ru/support/stunnel/dist/csp50/${ARCH_DIST}.tgz &&
|
||||
tar -xvf ${ARCH_DIST}.tgz;
|
||||
else
|
||||
wget https://$ACCOUNT@update.cryptopro.ru/support/stunnel/dist/csp50/${ARCH_DIST}_deb.tgz &&
|
||||
tar -xvf ${ARCH_DIST}_deb.tgz;
|
||||
fi
|
||||
fi
|
||||
before_script:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install openssl autoconf-archive expect; fi; true
|
||||
|
||||
script:
|
||||
- if [ "$ARCH" = "amd64" ]; then
|
||||
if [ "$BUILD_OS" = "centos" ]; then
|
||||
bash -ex ./build_amd64_centos.sh;
|
||||
else
|
||||
bash -ex ./build_amd64.sh;
|
||||
fi
|
||||
elif [ "$ARCH" = "armv7" ]; then
|
||||
bash -ex ./build_armv7.sh;
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
bash -ex ./build_arm64.sh;
|
||||
fi
|
||||
|
||||
after_success:
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: NdsZjaeC2SU8Eo9uL4gwxhCSIfYbDNxBxLi6jJsm/u55Ouqg4Iz0DOYx0l+C0yemBhSX8lnShhjRPKRbEMLRNDvBi/f55CCHOMhk0KlQt/fvkBAsPf/bHLle0KEszj33rfklF1uc1/R2PJn8iwkuVTslVmLCKOB+1E5KWRgWgQvjsEWl26KBH32RM6sqi9jXeKPgdNLxZYon//fhktEKhBsp8mtc6qigvUEhzwuHAREwdyCy6A46dNNfzxg3I01TpooOSCZsdkRg9vvOT0H7agF3Dj6RocozuzIj2NoIka5e4rKPW/EYqd0yLM77f+pgs10I30SNbQSqJcYSIfHfJNiup+q2rnGgQQHOowg7Gqj//ffVEwyhCM4F90QlTCcjNECmaRfhIjQk5ICeakNlWojSBDcA0yEmnTu7BKTsZJOnjLFH8r6DrJmSta2ZNMdacgEaG+al3CoW57GOp6Nukbo1PGBYfZ3L/2QvguklKQGL/rAoVbR+PujjLyqfNwpt8ije9N7SvqporVeAOmpMGrNDQ94Ss3cXMhaJUJxfdg5lMsBm2qUytn5jeO4BTtBgyiyK/LyWMJg3NkUx1egVJbkoOwHSRT0VH7y8uYzvxYtYtTikBdmgfd25wZ+dQTANWbiFtkQs/DZqCnJ2nFTDNfTKyhtmSJZJXM6/Xerxt3c=
|
||||
skip_cleanup: true
|
||||
file:
|
||||
- "src/${TRAVIS_TAG}_${ARCH_DIST}${BUILD_OS:+_$BUILD_OS}.tar.gz"
|
||||
on:
|
||||
tags: true
|
||||
condition: $MSSPI = "yes"
|
|
@ -73,7 +73,7 @@ else
|
|||
# Возможно нужно выставить PERLLIB и PERL5LIB
|
||||
sudo perl test-stunnel-msspi.pl || exit 1
|
||||
cd ../src
|
||||
tar -cvzf ${TRAVIS_TAG}_linux-mipsel.tar.gz stunnel-msspi
|
||||
tar -cvzf ${BUILD_TAG}_linux-mipsel.tar.gz stunnel-msspi
|
||||
cd ..;
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -27,7 +27,7 @@ else
|
|||
cd tests
|
||||
sudo perl test-stunnel-msspi.pl || exit 1
|
||||
cd ../src
|
||||
tar -cvzf ${TRAVIS_TAG}_linux-amd64.tar.gz stunnel-msspi
|
||||
tar -cvzf ${GITHUB_REF#refs/*/}-amd64-ubuntu.tar.gz stunnel-msspi
|
||||
cd ..;
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -32,7 +32,7 @@ if [ "$1" = "in_docker" ]; then
|
|||
cd tests
|
||||
sudo perl test-stunnel-msspi.pl || exit 1
|
||||
cd ../src
|
||||
tar -cvzf ${TRAVIS_TAG}_linux-amd64${BUILD_OS:+_$BUILD_OS}.tar.gz stunnel-msspi
|
||||
tar -cvzf ${BUILD_TAG}-amd64-centos.tar.gz stunnel-msspi
|
||||
cd ..;
|
||||
fi
|
||||
fi
|
||||
|
@ -43,7 +43,7 @@ else
|
|||
sleep 5
|
||||
|
||||
echo "export BUILD_OS='${BUILD_OS}'" > envvars.sh
|
||||
echo "export TRAVIS_TAG='${TRAVIS_TAG}'" >> envvars.sh
|
||||
echo "export BUILD_TAG='${GITHUB_REF#refs/*/}'" >> envvars.sh
|
||||
echo "export CONFIGURE_OPTIONS='${CONFIGURE_OPTIONS}'" >> envvars.sh
|
||||
echo "export CSPMODE='${CSPMODE}'" >> envvars.sh
|
||||
echo "export MSSPI='${MSSPI}'" >> envvars.sh
|
||||
|
|
|
@ -5,8 +5,6 @@ MIRROR=http://ports.ubuntu.com/ubuntu-ports
|
|||
VERSION=trusty
|
||||
CHROOT_ARCH=arm64
|
||||
CPRO_SUFFIX=aarch64
|
||||
#TRAVIS_BUILD_DIR=/home/full/stunnel
|
||||
#MSSPI=yes
|
||||
|
||||
# Debian package dependencies for the host
|
||||
HOST_DEPENDENCIES="debootstrap qemu-user-static binfmt-support sbuild"
|
||||
|
@ -58,11 +56,11 @@ if [ ! -e "/.chroot_arm64_is_done" ]; then
|
|||
|
||||
# Create file with environment variables which will be used inside chrooted
|
||||
# environment
|
||||
echo "export TRAVIS_BUILD_DIR='${TRAVIS_BUILD_DIR}'" > envvars.sh
|
||||
echo "export BUILD_DIR='${BUILD_DIR}'" > envvars.sh
|
||||
echo "export CONFIGURE_OPTIONS='${CONFIGURE_OPTIONS}'" >> envvars.sh
|
||||
echo "export MSSPI='${MSSPI}'" >> envvars.sh
|
||||
echo "export CSPMODE='${CSPMODE}'" >> envvars.sh
|
||||
echo "export TRAVIS_TAG='${TRAVIS_TAG}'" >> envvars.sh
|
||||
echo "export BUILD_TAG='${GITHUB_REF#refs/*/}'" >> envvars.sh
|
||||
echo "export CPRO_SUFFIX='${CPRO_SUFFIX}'" >> envvars.sh
|
||||
chmod a+x envvars.sh
|
||||
cat envvars.sh
|
||||
|
@ -72,15 +70,15 @@ if [ ! -e "/.chroot_arm64_is_done" ]; then
|
|||
sudo chroot ${CHROOT_DIR} apt-get --allow-unauthenticated install \
|
||||
-qq -y ${GUEST_DEPENDENCIES} || exit 1
|
||||
|
||||
# Create build dir and copy travis build files to our chroot environment
|
||||
sudo mkdir -p ${CHROOT_DIR}${TRAVIS_BUILD_DIR} || exit 1
|
||||
sudo rsync -av ${TRAVIS_BUILD_DIR}/ ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/ || exit 1
|
||||
# Create build dir and copy build files to our chroot environment
|
||||
sudo mkdir -p ${CHROOT_DIR}${BUILD_DIR} || exit 1
|
||||
sudo rsync -aq ${BUILD_DIR}/ ${CHROOT_DIR}${BUILD_DIR}/ || exit 1
|
||||
|
||||
# Indicate chroot environment has been set up
|
||||
sudo touch ${CHROOT_DIR}/.chroot_arm64_is_done || exit 1
|
||||
|
||||
# Call ourselves again which will cause tests to run
|
||||
sudo chroot ${CHROOT_DIR} bash -cex "cd ${TRAVIS_BUILD_DIR} && ./build_arm64.sh" || exit 1
|
||||
sudo chroot ${CHROOT_DIR} bash -cex "cd ${BUILD_DIR} && ./build_arm64.sh" || exit 1
|
||||
#-----------------------------------------------------------------------------
|
||||
else
|
||||
# We are inside ARM chroot
|
||||
|
@ -145,7 +143,7 @@ else
|
|||
cd tests
|
||||
perl test-stunnel-msspi.pl || exit 1
|
||||
cd ../src
|
||||
tar -cvzf ${TRAVIS_TAG}_linux-arm64.tar.gz stunnel-msspi
|
||||
tar -cvzf ${BUILD_TAG}_linux-arm64.tar.gz stunnel-msspi
|
||||
cd ..;
|
||||
fi
|
||||
fi
|
||||
|
@ -153,4 +151,4 @@ else
|
|||
exit 0
|
||||
fi
|
||||
|
||||
mv ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/src/${TRAVIS_TAG}_linux-arm64.tar.gz ./src/
|
||||
mv ${CHROOT_DIR}${BUILD_DIR}/src/${GITHUB_REF#refs/*/}_linux-arm64.tar.gz ./src/
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
CHROOT_DIR=/tmp/armv7-chroot
|
||||
MIRROR=http://archive.raspbian.org/raspbian
|
||||
VERSION=jessie
|
||||
VERSION=stable
|
||||
CHROOT_ARCH=armhf
|
||||
ARCH=arm
|
||||
#TRAVIS_BUILD_DIR=/home/full/stunnel
|
||||
#BUILD_DIR=/home/full/stunnel
|
||||
#MSSPI=yes
|
||||
|
||||
# Debian package dependencies for the host
|
||||
|
@ -57,12 +57,12 @@ if [ ! -e "/.chroot_is_done" ]; then
|
|||
|
||||
# Create file with environment variables which will be used inside chrooted
|
||||
# environment
|
||||
echo "export TRAVIS_BUILD_DIR='${TRAVIS_BUILD_DIR}'" > envvars.sh
|
||||
echo "export BUILD_DIR='${BUILD_DIR}'" > envvars.sh
|
||||
echo "export ARCH='${ARCH}'" >> envvars.sh
|
||||
echo "export CONFIGURE_OPTIONS='${CONFIGURE_OPTIONS}'" >> envvars.sh
|
||||
echo "export MSSPI='${MSSPI}'" >> envvars.sh
|
||||
echo "export CSPMODE='${CSPMODE}'" >> envvars.sh
|
||||
echo "export TRAVIS_TAG='${TRAVIS_TAG}'" >> envvars.sh
|
||||
echo "export BUILD_TAG='${GITHUB_REF#refs/*/}'" >> envvars.sh
|
||||
echo "export CPRO_SUFFIX='arm'" >> envvars.sh
|
||||
chmod a+x envvars.sh
|
||||
cat envvars.sh
|
||||
|
@ -72,15 +72,15 @@ if [ ! -e "/.chroot_is_done" ]; then
|
|||
sudo chroot ${CHROOT_DIR} apt-get --allow-unauthenticated install \
|
||||
-qq -y ${GUEST_DEPENDENCIES} || exit 1
|
||||
|
||||
# Create build dir and copy travis build files to our chroot environment
|
||||
sudo mkdir -p ${CHROOT_DIR}${TRAVIS_BUILD_DIR} || exit 1
|
||||
sudo rsync -av ${TRAVIS_BUILD_DIR}/ ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/ || exit 1
|
||||
# Create build dir and copy build files to our chroot environment
|
||||
sudo mkdir -p ${CHROOT_DIR}${BUILD_DIR} || exit 1
|
||||
sudo rsync -aq ${BUILD_DIR}/ ${CHROOT_DIR}${BUILD_DIR}/ || exit 1
|
||||
|
||||
# Indicate chroot environment has been set up
|
||||
sudo touch ${CHROOT_DIR}/.chroot_is_done || exit 1
|
||||
|
||||
# Call ourselves again which will cause tests to run
|
||||
sudo chroot ${CHROOT_DIR} bash -cex "cd ${TRAVIS_BUILD_DIR} && ./build_armv7.sh" || exit 1
|
||||
sudo chroot ${CHROOT_DIR} bash -cex "cd ${BUILD_DIR} && ./build_armv7.sh" || exit 1
|
||||
#-----------------------------------------------------------------------------
|
||||
else
|
||||
# We are inside ARM chroot
|
||||
|
@ -139,7 +139,7 @@ else
|
|||
cd tests
|
||||
perl test-stunnel-msspi.pl || exit 1
|
||||
cd ../src
|
||||
tar -cvzf ${TRAVIS_TAG}_linux-armhf.tar.gz stunnel-msspi
|
||||
tar -cvzf ${BUILD_TAG}_linux-armhf.tar.gz stunnel-msspi
|
||||
cd ..;
|
||||
fi
|
||||
fi
|
||||
|
@ -147,4 +147,4 @@ else
|
|||
exit 0
|
||||
fi
|
||||
|
||||
mv ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/src/${TRAVIS_TAG}_linux-armhf.tar.gz ./src/
|
||||
mv ${CHROOT_DIR}${BUILD_DIR}/src/${GITHUB_REF#refs/*/}_linux-armhf.tar.gz ./src/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
use lib '.';
|
||||
use strict;
|
||||
use Scripts;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
##############################################################################
|
||||
|
||||
use lib '.';
|
||||
use strict;
|
||||
use Scripts;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
use lib '.';
|
||||
use strict;
|
||||
use Scripts;
|
||||
use IO::Select;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
|
||||
use lib '.';
|
||||
use strict;
|
||||
use Scripts;
|
||||
use IO::Select;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use lib '.';
|
||||
use strict;
|
||||
use Scripts;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче