Viewer: Prevent exception if '-' passed as arg #471
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
pull_request: | |
workflow_dispatch: | |
env: | |
LJT_VERSION: 2.0.6 | |
LJT_GPG_KEY: https://raw.githubusercontent.com/libjpeg-turbo/repo/main/LJT-GPG-KEY | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set global environment variables | |
run: | | |
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV | |
echo "LJT_URL=https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LJT_VERSION" >>$GITHUB_ENV | |
- name: Set global environment variables, Phase 2 | |
run: | | |
echo "LJT_LINUX_JNI=$LJT_URL/libjpeg-turbo-$LJT_VERSION-jws.zip" >>$GITHUB_ENV | |
echo "LJT_OSX_JNI=$LJT_URL/libjpeg-turbo-$LJT_VERSION-jws.zip" >>$GITHUB_ENV | |
echo "LJT_WINDOWS_JNI=$LJT_URL/libjpeg-turbo-$LJT_VERSION-jws.zip" >>$GITHUB_ENV | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up build | |
run: | | |
mkdir -p $HOME/src/vnc.nightly | |
docker pull dcommander/buildvnc:$BRANCH | |
mkdir $HOME/libjpeg-turbo-jni | |
pushd $HOME/libjpeg-turbo-jni | |
wget --no-check-certificate $LJT_LINUX_JNI -O libjpeg-turbo-jws.zip | |
unzip libjpeg-turbo-jws.zip | |
rm libjpeg-turbo-jws.zip | |
if [ "$LJT_OSX_JNI" != "$LJT_LINUX_JNI" ]; then | |
wget --no-check-certificate $LJT_OSX_JNI -O libjpeg-turbo-jws.zip | |
unzip libjpeg-turbo-jws.zip | |
rm libjpeg-turbo-jws.zip | |
fi | |
if [ "$LJT_WINDOWS_JNI" != "$LJT_LINUX_JNI" ]; then | |
wget --no-check-certificate $LJT_WINDOWS_JNI -O libjpeg-turbo-jws.zip | |
unzip libjpeg-turbo-jws.zip | |
rm libjpeg-turbo-jws.zip | |
fi | |
popd | |
git clone --depth=1 https://github.com/turbovnc/buildscripts.git -b $BRANCH $HOME/src/buildscripts | |
mkdir $HOME/libjpeg-turbo-rpm | |
pushd $HOME/libjpeg-turbo-rpm | |
wget --no-check-certificate $LJT_URL/libjpeg-turbo-official-$LJT_VERSION.x86_64.rpm $LJT_URL/libjpeg-turbo-official-$LJT_VERSION.i386.rpm | |
popd | |
mkdir $HOME/rpmkeys | |
wget --no-check-certificate "$LJT_GPG_KEY" -O $HOME/rpmkeys/LJT-GPG-KEY | |
wget --no-check-certificate http://www.virtualgl.org/key/VGLPR-GPG-KEY -O $HOME/rpmkeys/VGLPR-GPG-KEY | |
- name: Configure GPG signing | |
if: ${{github.event_name != 'pull_request'}} | |
run: | | |
sudo apt install -y gnupg1 | |
printf "${{secrets.GPG_KEY}}" | base64 --decode | gpg1 --batch --import - | |
chmod 600 $HOME/.gnupg/gpg.conf | |
echo "GPG_KEY_NAME=\"${{secrets.GPG_KEY_NAME}}\"" >$HOME/src/buildscripts/gpgsign | |
echo "GPG_KEY_ID=${{secrets.GPG_KEY_ID}}" >>$HOME/src/buildscripts/gpgsign | |
echo "GPG_KEY_PASS=${{secrets.GPG_KEY_PASS}}" >>$HOME/src/buildscripts/gpgsign | |
- name: Build | |
run: | | |
docker run -v $HOME/src/vnc.nightly:/root/src/vnc.nightly -v $HOME/src/buildscripts:/root/src/buildscripts -v $GITHUB_WORKSPACE:/root/src/turbovnc -v $HOME/.gnupg:/root/.gnupg -v $HOME/libjpeg-turbo-jni:/opt/libjpeg-turbo-jni -v $HOME/libjpeg-turbo-rpm:/rpms -v $HOME/rpmkeys:/rpmkeys -t dcommander/buildvnc:$BRANCH bash -c "rpm --import /rpmkeys/LJT-GPG-KEY && rpm -K /rpms/*.rpm && rpm -i /rpms/*.rpm && rpm --import /rpmkeys/VGLPR-GPG-KEY && ~/src/buildscripts/buildvnc -d /root/src/turbovnc -v" | |
sudo chown -R runner:runner $HOME/src/vnc.nightly | |
mv $HOME/src/vnc.nightly/latest/log-${{github.job}}.txt $HOME/src/vnc.nightly/latest/files/ | |
linux-non-default-options: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set global environment variables | |
run: | | |
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV | |
echo "LJT_URL=https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LJT_VERSION" >>$GITHUB_ENV | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up build | |
run: | | |
sudo apt install -y libxi-dev | |
mkdir $HOME/libjpeg-turbo-deb | |
pushd $HOME/libjpeg-turbo-deb | |
wget --no-check-certificate $LJT_URL/libjpeg-turbo-official_$LJT_VERSION\_amd64.deb $LJT_URL/libjpeg-turbo-official32_$LJT_VERSION\_amd64.deb | |
sudo dpkg -i *.deb | |
rm *.deb | |
popd | |
rmdir $HOME/libjpeg-turbo-deb | |
- name: Build | |
run: | | |
mkdir build | |
pushd build | |
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTVNC_USEPAM=0 -DTVNC_USETLS=0 -DCMAKE_C_FLAGS="--std=gnu90 -Wall -Werror -Wextra -Wdouble-promotion -Wformat=2 -Wformat-overflow=2 -Wmissing-include-dirs -Wshift-overflow=2 -Wswitch-bool -Wno-unused-parameter -Wuninitialized -Wstrict-overflow=2 -Wstringop-overflow=4 -Wstringop-truncation -Wduplicated-cond -Wdeclaration-after-statement -Wshadow -Wunsafe-loop-optimizations -Wcast-align -Wno-cast-function-type -Wjump-misses-init -Wno-sign-compare -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wno-missing-field-initializers -Wpacked -Wredundant-decls -Wnested-externs -Winline --param max-inline-insns-single=1000 -Wdisabled-optimization" .. | |
export NUMCPUS=`grep -c '^processor' /proc/cpuinfo` | |
make -j$NUMCPUS --load-average=$NUMCPUS | |
popd | |
macos: | |
runs-on: macos-12 | |
steps: | |
- name: Set global environment variables | |
run: | | |
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV | |
echo "LJT_URL=https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LJT_VERSION" >>$GITHUB_ENV | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up build | |
run: | | |
brew install md5sha1sum | |
sudo xcode-select -s /Applications/Xcode_13.2.1.app | |
mkdir -p $HOME/src/vnc.nightly | |
git clone --depth=1 https://github.com/turbovnc/buildscripts.git -b $BRANCH $HOME/src/buildscripts | |
mkdir $HOME/libjpeg-turbo-dmg | |
pushd $HOME/libjpeg-turbo-dmg | |
wget --no-check-certificate $LJT_URL/libjpeg-turbo-$LJT_VERSION.dmg | |
hdid libjpeg-turbo-$LJT_VERSION.dmg | |
sudo installer -pkg /Volumes/libjpeg-turbo-$LJT_VERSION/libjpeg-turbo.pkg -target / | |
hdiutil detach /Volumes/libjpeg-turbo-$LJT_VERSION | |
rm *.dmg | |
popd | |
rmdir $HOME/libjpeg-turbo-dmg | |
- name: Configure GPG signing | |
if: ${{github.event_name != 'pull_request'}} | |
run: | | |
printf "${{secrets.GPG_KEY}}" | base64 --decode | gpg --batch --import - | |
echo "GPG_KEY_NAME=\"${{secrets.GPG_KEY_NAME}}\"" >$HOME/src/buildscripts/gpgsign | |
echo "GPG_KEY_ID=${{secrets.GPG_KEY_ID}}" >>$HOME/src/buildscripts/gpgsign | |
echo "GPG_KEY_PASS=${{secrets.GPG_KEY_PASS}}" >>$HOME/src/buildscripts/gpgsign | |
- name: Build | |
run: | | |
$HOME/src/buildscripts/buildvnc -d $GITHUB_WORKSPACE -v | |
mv $HOME/src/vnc.nightly/latest/log-${{github.job}}.txt $HOME/src/vnc.nightly/latest/files/ |