mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-11-04 18:19:42 +08:00
Add Travis-CI build script
This commit is contained in:
parent
380260af21
commit
da69afbe8a
35
.travis.yml
Normal file
35
.travis.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
language: cpp
|
||||||
|
sudo: required
|
||||||
|
stages:
|
||||||
|
- name: deploy
|
||||||
|
if: branch = master
|
||||||
|
- name: before_script
|
||||||
|
if: branch = master
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: osx
|
||||||
|
compiler: clang
|
||||||
|
osx_image: xcode10.3
|
||||||
|
script:
|
||||||
|
- chmod +x build.macos.release.sh
|
||||||
|
- ./build.macos.release.sh
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key: "$GITHUB_OAUTH_TOKEN"
|
||||||
|
file: "subconverter_darwin64.tar.gz"
|
||||||
|
skip_cleanup: true
|
||||||
|
draft: true
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
- services: docker
|
||||||
|
script:
|
||||||
|
- docker pull alpine:latest
|
||||||
|
- docker run -v $TRAVIS_BUILD_DIR:/root/workdir alpine:latest /bin/sh -c "apk add bash git && cd /root/workdir && chmod +x build.alpine.release.sh && bash build.alpine.release.sh"
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key: "$GITHUB_OAUTH_TOKEN"
|
||||||
|
file: "subconverter_linux64.tar.gz"
|
||||||
|
skip_cleanup: true
|
||||||
|
draft: true
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
38
build.alpine.release.sh
Normal file
38
build.alpine.release.sh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
mkdir obj
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool
|
||||||
|
apk add libressl-dev zlib-dev rapidjson-dev
|
||||||
|
|
||||||
|
git clone https://github.com/curl/curl
|
||||||
|
cd curl
|
||||||
|
./buildconf
|
||||||
|
./configure > /dev/null
|
||||||
|
make install -j4
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
git clone https://github.com/jbeder/yaml-cpp
|
||||||
|
cd yaml-cpp
|
||||||
|
cmake .
|
||||||
|
make install -j4
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
git clone git://sourceware.org/git/bzip2.git
|
||||||
|
cd bzip2
|
||||||
|
make install -j4
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c logger.cpp -o obj\logger.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c main.cpp -o obj\main.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c misc.cpp -o obj\misc.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c nodemanip.cpp -o obj\nodemanip.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c rapidjson_extra.cpp -o obj\rapidjson_extra.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c speedtestutil.cpp -o obj\speedtestutil.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c subexport.cpp -o obj\subexport.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c webget.cpp -o obj\webget.o
|
||||||
|
g++ -Wall -std=c++1z -fexceptions -DCURL_STATICLIB -c webserver_libevent.cpp -o obj\webserver_libevent.o
|
||||||
|
g++ -o subconverter obj\logger.o obj\main.o obj\misc.o obj\nodemanip.o obj\rapidjson_extra.o obj\speedtestutil.o obj\subexport.o obj\webget.o obj\webserver_libevent.o -static -levent -lyaml-cpp -lcurl -lssl -lcrypto -lz -lbz2 -ldl -lpthread -O3 -s
|
||||||
|
|
||||||
|
chmod +rx subconverter pref.ini *.yml
|
||||||
|
tar czf subconverter_linux64.tar.gz subconverter pref.ini *.yml
|
||||||
40
build.macos.release.sh
Normal file
40
build.macos.release.sh
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
mkdir obj
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
brew reinstall yaml-cpp rapidjson libevent zlib
|
||||||
|
|
||||||
|
git clone https://github.com/curl/curl
|
||||||
|
cd curl
|
||||||
|
./buildconf
|
||||||
|
./configure --with-ssl=/usr/local/opt/openssl@1.1 --without-mbedtls --disable-ldap --disable-ldaps --disable-rtsp --without-libidn2
|
||||||
|
make -j8
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
curl -L -o bzip2-1.0.6.tar.gz https://sourceforge.net/projects/bzip2/files/bzip2-1.0.6.tar.gz/download
|
||||||
|
tar xvf bzip2-1.0.6.tar.gz
|
||||||
|
cd bzip2-1.0.6
|
||||||
|
make -j8
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cp /usr/local/lib/libevent.a .
|
||||||
|
cp /usr/local/opt/zlib/lib/libz.a .
|
||||||
|
cp /usr/local/opt/openssl@1.1/lib/libssl.a .
|
||||||
|
cp /usr/local/opt/openssl@1.1/lib/libcrypto.a .
|
||||||
|
cp /usr/local/lib/libyaml-cpp.a .
|
||||||
|
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c logger.cpp -o obj\logger.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c main.cpp -o obj\main.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c misc.cpp -o obj\misc.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c nodemanip.cpp -o obj\nodemanip.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c rapidjson_extra.cpp -o obj\rapidjson_extra.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c speedtestutil.cpp -o obj\speedtestutil.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c subexport.cpp -o obj\subexport.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c webget.cpp -o obj\webget.o
|
||||||
|
c++ -Wall -std=c++17 -fexceptions -DCURL_STATICLIB -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include -c webserver_libevent.cpp -o obj\webserver_libevent.o
|
||||||
|
c++ -Xlinker -unexported_symbol -Xlinker "*" -o subconverter obj\logger.o obj\main.o obj\misc.o obj\nodemanip.o obj\rapidjson_extra.o obj\speedtestutil.o obj\subexport.o obj\webget.o obj\webserver_libevent.o libevent.a curl/lib/.libs/libcurl.a libz.a libssl.a libcrypto.a libyaml-cpp.a bzip2-1.0.6/libbz2.a -ldl -lpthread -O3 -s
|
||||||
|
|
||||||
|
chmod +rx subconverter pref.ini *.yml
|
||||||
|
tar czf subconverter_darwin64.tar.gz subconverter pref.ini *.yml
|
||||||
|
|
||||||
|
set +xe
|
||||||
Loading…
Reference in New Issue
Block a user