1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 19:54:48 +08:00

Update CI scripts

This commit is contained in:
Wu Yufei 2020-11-12 23:06:51 +08:00
parent c06dc63e8c
commit 84b913d240
No known key found for this signature in database
GPG Key ID: 226E1C0EDF292D66
2 changed files with 42 additions and 9 deletions

View File

@ -18,6 +18,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '^3.7' # request python 3.7+ for datetime.datetime.fromisoformat
- name: Build Packages - name: Build Packages
run: | run: |
cd build cd build

View File

@ -6,17 +6,46 @@ fail() {
echo -e "\033[31mERROR: Failed to build $1\033[0m" 1>&2 echo -e "\033[31mERROR: Failed to build $1\033[0m" 1>&2
} }
if [[ $# -gt 0 ]]; then
for arg in $*; do
case $arg in
rpm)
USE_RPM=1
;;
debian)
USE_DEB=1
;;
openwrt)
USE_OPK=1
;;
*)
echo "Invalid package $arg"
exit 1
esac
done
else
USE_RPM=1
USE_DEB=1
USE_OPK=1
fi
if [[ ! -z $USE_RPM ]]; then
pushd rpm > /dev/null pushd rpm > /dev/null
./build.sh $VERSION || fail 'RPM package' ./build.sh $VERSION || fail 'RPM package'
popd > /dev/null popd > /dev/null
fi
if [[ ! -z $USE_DEB ]]; then
pushd debian > /dev/null pushd debian > /dev/null
./build.sh $VERSION || fail 'Debian package' ./build.sh $VERSION || fail 'Debian package'
popd > /dev/null popd > /dev/null
fi
if [[ ! -z $USE_OPK ]]; then
pushd openwrt > /dev/null pushd openwrt > /dev/null
./build.sh $VERSION || fail 'OpenWrt package' ./build.sh $VERSION || fail 'OpenWrt package'
popd > /dev/null popd > /dev/null
fi
echo -ne "\033[0;32m" echo -ne "\033[0;32m"
find . -regextype posix-egrep -regex ".*\.(opk|deb|rpm)$" find . -regextype posix-egrep -regex ".*\.(opk|deb|rpm)$"