mirror of
https://github.com/QSCTech/zjunet.git
synced 2026-01-23 04:04:48 +08:00
Update CI scripts
This commit is contained in:
parent
c06dc63e8c
commit
84b913d240
4
.github/workflows/packaging.yml
vendored
4
.github/workflows/packaging.yml
vendored
@ -18,6 +18,10 @@ jobs:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- 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
|
||||
run: |
|
||||
cd build
|
||||
|
||||
@ -6,17 +6,46 @@ fail() {
|
||||
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
|
||||
./build.sh $VERSION || fail 'RPM package'
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
if [[ ! -z $USE_DEB ]]; then
|
||||
pushd debian > /dev/null
|
||||
./build.sh $VERSION || fail 'Debian package'
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
if [[ ! -z $USE_OPK ]]; then
|
||||
pushd openwrt > /dev/null
|
||||
./build.sh $VERSION || fail 'OpenWrt package'
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
echo -ne "\033[0;32m"
|
||||
find . -regextype posix-egrep -regex ".*\.(opk|deb|rpm)$"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user