Files
Martin Pulec 972d0432c6 GitHub CI [Win]: AJA build fix
Current MSVS requires explicit target "Rebuild" for some reason.
Explicit target "Build" doesn't work for some reason (perhaps some
error in project file?).
2021-06-08 16:04:43 +02:00

308 lines
13 KiB
YAML

name: C/C++ CI
env:
FEATURES: '--enable-option-checking=fatal --with-live555=/usr/local --enable-blank --enable-cineform --enable-decklink --enable-file --enable-gl --enable-jack --enable-jack-transport --enable-libavcodec --enable-natpmp --enable-openssl --enable-pcp --enable-portaudio --enable-qt --enable-rtdxt --enable-rtsp --enable-rtsp-server --enable-scale --enable-sdl2 --enable-sdp-http --enable-speexdsp --enable-swmix --enable-libswscale --enable-text --enable-video-mixer --enable-ximea --enable-zfec'
CUDA_FEATURES: '--enable-cuda_dxt --enable-gpujpeg --enable-ldgm-gpu --enable-uyvy'
on:
push:
branches:
- master
- ndi-build
- 'release/*'
paths:
- '.github/scripts/**'
- '.github/workflows/ccpp.yml'
- '**.c'
- '**.cpp'
- '**.cu'
- '**.h'
- '**.hpp'
- '**.m'
- '**.mm'
- 'autogen.sh'
- 'cineform-sdk'
- 'configure.ac'
- 'data/scripts/**'
- 'gpujpeg'
- 'Makefile.in'
jobs:
prepare:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, we do not need to create own token.
steps:
- uses: actions/checkout@v2
id: checkout
if: github.repository == 'CESNET/UltraGrid' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/'))
with:
persist-credentials: true
- name: Retag
if: steps.checkout.conclusion != 'skipped'
run: |
. .github/scripts/environment.sh
git fetch --prune --unshallow --tags
git tag -f $TAG
git push -f origin refs/tags/$TAG:refs/tags/$TAG
- name: Update Release
if: steps.checkout.conclusion != 'skipped' && env.VERSION == 'continuous'
run: |
sudo apt install jq
URL=$(curl -S -H "Authorization: token $GITHUB_TOKEN" -X GET https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/continuous | jq -r '.url')
REQ=PATCH
if [ $URL = null ]; then # release doesn't yet exist
REQ=POST
URL=https://api.github.com/repos/$GITHUB_REPOSITORY/releases
fi
DATE=$(date -Iminutes)
curl -S -H "Authorization: token $GITHUB_TOKEN" -X $REQ $URL -T - <<EOF
{
"tag_name": "continuous", "name": "continuous builds",
"body": "Last update $DATE\n\nCurrent builds from Git master branch. macOS alternative build is rebuilt daily, Linux ARM builds occasionally. Archived builds can be found [here](https://frakira.fi.muni.cz/~xpulec/ug-nightly-archive/).",
"draft": false, "prerelease": true
}
EOF
Ubuntu:
name: run Ubuntu
needs: prepare
runs-on: ubuntu-16.04
env:
appimage_key: ${{ secrets.appimage_key }}
SDK_URL: ${{ secrets.SDK_URL }}
steps:
- uses: actions/checkout@v1
- name: bootstrap
run: |
. .github/scripts/environment.sh
.github/scripts/Linux/prepare.sh
- name: Cache FFmpeg
id: cache-ffmpeg
uses: actions/cache@v1
with:
path: '/var/tmp/ffmpeg'
key: cache-ffmpeg-12
- name: Build FFmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: .github/scripts/Linux/download_build_ffmpeg.sh
- name: Install FFmpeg
run: .github/scripts/Linux/install_ffmpeg.sh
- name: configure
run: "./autogen.sh --with-cuda-host-compiler=$CUDA_HOST_COMPILER --enable-plugins ${{ env.CUDA_FEATURES }} ${{ env.FEATURES }} --enable-alsa $NDI --enable-v4l2"
- name: make
run: make -j4
- name: make check
run: make check
- name: make distcheck
run: make distcheck
- name: check libstdc++ ABI
run: .github/scripts/Linux/check_abi.sh 2.23 3.4.21 1.3.9 bin/* lib/ultragrid/*
- name: Create AppImage
run: APPIMAGE=`data/scripts/Linux-AppImage/create-appimage.sh https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/UltraGrid-$VERSION-x86_64.AppImage.zsync` && mv $APPIMAGE UltraGrid-$VERSION-x86_64.AppImage
- name: Check AppImage
run: |
docker build -f .github/scripts/Linux/utils/Dockerfile.ubuntu-16.04 -t aitest-ubuntu-16.04 .
curl -LS -O https://raw.githubusercontent.com/AppImage/pkg2appimage/master/appdir-lint.sh -O https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist
sudo apt install desktop-file-utils libfile-mimeinfo-perl # desktop-file-validate, mimetype
./UltraGrid-$VERSION-x86_64.AppImage --appimage-extract
docker run --rm -v $PWD/squashfs-root/:/AppImage aitest-ubuntu-16.04 /AppImage/AppRun -v
docker run --rm -v $PWD/squashfs-root/:/AppImage aitest-ubuntu-16.04 /AppImage/AppRun --tool uv-qt -h
docker run --rm -v $PWD/squashfs-root/:/AppImage aitest-ubuntu-16.04 /AppImage/AppRun --list-modules
bash appdir-lint.sh squashfs-root
- name: Upload NDI Build
id: upload-ndi
env:
NDI_REMOTE_SSH_KEY: ${{ secrets.NDI_REMOTE_SSH_KEY }}
if: github.ref == 'refs/heads/ndi-build' && env.NDI_REMOTE_SSH_KEY != null
run: .github/scripts/upload-ndi-build.sh UltraGrid-$VERSION-x86_64.AppImage
- name: Upload Release Asset
id: upload-release
if: github.repository == 'CESNET/UltraGrid' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo apt install jq zsync
zsyncmake -C UltraGrid-$VERSION-x86_64.AppImage
.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION-x86_64.AppImage.zsync application/x-zsync AppImage%20zsync
.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION-x86_64.AppImage application/x-appimage Linux%20build
- name: Upload Build
if: steps.upload-ndi.conclusion == 'skipped' && steps.upload-release.conclusion == 'skipped'
uses: actions/upload-artifact@v1
with:
name: UltraGrid CI Linux build
path: UltraGrid-${{ env.VERSION }}-x86_64.AppImage
macOS:
name: run macOS
needs: prepare
runs-on: macos-latest
env:
SDK_NONFREE_PATH: /var/tmp/sdks-nonfree
altool_credentials: ${{ secrets.altool_credentials }}
apple_key_p12_b64: ${{ secrets.apple_key_p12_b64 }}
SDK_URL: ${{ secrets.SDK_URL }}
steps:
- uses: actions/checkout@v1
- name: Cache Non-Free SDKs
id: cache-macos-nonfree-sdks
uses: actions/cache@v1
with:
path: ${{ env.SDK_NONFREE_PATH }}
key: cache-macos-nonfree-sdks-2
- name: Download Non-Free SDKs
if: steps.cache-macos-nonfree-sdks.outputs.cache-hit != 'true' && env.SDK_URL != null
run: |
rm -rf ${{ env.SDK_NONFREE_PATH }}
mkdir -p ${{ env.SDK_NONFREE_PATH }}
cd ${{ env.SDK_NONFREE_PATH }}
curl -S -f -O $SDK_URL/ntv2sdkmac.zip --next -f -O $SDK_URL/VideoMaster_SDK_MacOSX.zip --next -f -O $SDK_URL/NDISDK_Apple.pkg || true
$GITHUB_WORKSPACE/.github/scripts/macOS/prepare_nonfree_sdks.sh
- name: Cache Free SDKs
id: cache-macos-free-sdks
uses: actions/cache@v1
with:
path: '/var/tmp/sdks-free'
key: cache-macos-free-sdks
- name: Download Free SDKs
if: steps.cache-macos-free-sdks.outputs.cache-hit != 'true'
run: |
mkdir -p /var/tmp/sdks-free
cd /var/tmp/sdks-free
curl -S -LO https://www.ximea.com/downloads/recent/XIMEA_OSX_SP.dmg
- name: bootstrap
run: |
. .github/scripts/environment.sh
.github/scripts/macOS/prepare.sh
- name: configure
run: "export ARCH=-msse4.2; ./autogen.sh ${{ env.FEATURES }} --enable-avfoundation --enable-coreaudio --enable-deltacast $NDI --enable-syphon"
- name: make bundle
run: make -j4 gui-bundle
- name: sign+notarize
run: .github/scripts/macOS/sign.sh gui/QT/uv-qt.app
- name: make dmg
run: |
make osx-gui-dmg
mv UltraGrid.dmg UltraGrid-$VERSION.dmg
- name: make check
run: make check
- name: make distcheck
run: |
for n in lib opt; do sudo mv /usr/local/$n /usr/local/$n-; done # hide local libs
make distcheck TARGET=gui/QT/uv-qt.app/Contents/MacOS/uv REFLECTOR_TARGET=gui/QT/uv-qt.app/Contents/MacOS/uv GUI_EXE=gui/QT/uv-qt.app/Contents/MacOS/uv-qt
for n in lib opt; do sudo mv /usr/local/$n- /usr/local/$n; done # return back
- name: Upload NDI Build
id: upload-ndi
env:
NDI_REMOTE_SSH_KEY: ${{ secrets.NDI_REMOTE_SSH_KEY }}
if: github.ref == 'refs/heads/ndi-build' && env.NDI_REMOTE_SSH_KEY != null
run: .github/scripts/upload-ndi-build.sh UltraGrid-$VERSION.dmg
- name: Upload Release Asset
id: upload-release
if: github.repository == 'CESNET/UltraGrid' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
brew install jq
.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION.dmg application/x-apple-diskimage macOS%20build
- name: Upload Build
if: steps.upload-ndi.conclusion == 'skipped' && steps.upload-release.conclusion == 'skipped'
uses: actions/upload-artifact@v1
with:
name: UltraGrid CI macOS build
path: UltraGrid-${{ env.VERSION }}.dmg
Windows:
name: run Windows
needs: prepare
runs-on: windows-latest
env:
MSYS2_PATH_TYPE: inherit
SDK_URL: ${{ secrets.SDK_URL }}
steps:
- uses: actions/checkout@v1
- name: Set environment
run: .github/scripts/environment.sh
shell: bash
- name: Find MSVC
run: .github/scripts/Windows/find_msvc.ps1
- name: bootsrap
run: .github/scripts/Windows/prepare.ps1
- name: Cache AJA
id: cache-aja
uses: actions/cache@v1
with:
path: 'C:\AJA'
key: cache-aja-4
- name: Build AJA
if: steps.cache-aja.outputs.cache-hit != 'true'
run: .github/scripts/Windows/build_aja.ps1
- name: Cache JACK
id: cache-jack
uses: actions/cache@v1
with:
path: 'C:\Program Files\JACK2'
key: cache-jack-3
- name: Install JACK
if: steps.cache-jack.outputs.cache-hit != 'true'
run: .github/scripts/Windows/install_jack.ps1
- name: bootsrap MSYS2
run: C:\msys64\usr\bin\bash -cel '$GITHUB_WORKSPACE/.github/scripts/Windows/prepare_msys.sh'
- name: Cache live555
id: cache-live555
uses: actions/cache@v1
with:
path: 'C:\live555'
key: cache-live555-3
- name: Build live555
if: steps.cache-live555.outputs.cache-hit != 'true'
run: C:\msys64\usr\bin\bash -cel '$GITHUB_WORKSPACE/.github/scripts/Windows/build_live555.sh'
- name: Install live555
run: C:\msys64\usr\bin\bash -cel 'make -C /c/live555 install'
- name: configure
run: C:\msys64\usr\bin\bash -cel './autogen.sh --prefix=/ --bindir=/ --docdir=/doc ${{ env.FEATURES }} ${{ env.CUDA_FEATURES }} --enable-deltacast --enable-dshow $NDI --enable-spout --enable-wasapi'
- name: make
run: C:\msys64\usr\bin\bash -cel "make -j4"
- name: make check
run: C:\msys64\usr\bin\bash -cel "make check"
- name: add DLL depends
run: |
C:\msys64\usr\bin\bash -cel '
cp gui/QT/uv-qt.exe bin
rm bin/run_tests.exe
export DESTDIR=build/UltraGrid-$VERSION-win64
make install
IFS=\"|\"; for exe in $DESTDIR/*exe; do for n in `data/scripts/get_dll_depends.sh \"$exe\" | tr \"\n\" \"|\"`; do cp \"$n\" $DESTDIR; done; done
windeployqt $DESTDIR/uv-qt.exe
cp data/update.ps1 $DESTDIR'
- name: make dist-check
run: C:\msys64\usr\bin\bash -cel 'PATH=
/usr/bin/make distcheck TARGET=build/UltraGrid-$VERSION-win64/uv.exe REFLECTOR_TARGET=build/UltraGrid-$VERSION-win64/hd-rum-transcode.exe GUI_EXE=build/UltraGrid-$VERSION-win64/uv-qt.exe'
- name: Upload NDI Build
id: upload-ndi
env:
NDI_REMOTE_SSH_KEY: ${{ secrets.NDI_REMOTE_SSH_KEY }}
if: github.ref == 'refs/heads/ndi-build' && env.NDI_REMOTE_SSH_KEY != null
run: |
C:\msys64\usr\bin\bash -cel 'cd build; zip -9 -r UltraGrid-$VERSION-win64.zip UltraGrid-$VERSION-win64
$GITHUB_WORKSPACE/.github/scripts/upload-ndi-build.sh UltraGrid-$VERSION-win64.zip'
- name: Upload Release Asset
id: upload-release
if: github.repository == 'CESNET/UltraGrid' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
C:\msys64\usr\bin\bash -cel 'cd build; zip -9 -r UltraGrid-$VERSION-win64.zip UltraGrid-$VERSION-win64
$GITHUB_WORKSPACE/.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION-win64.zip application/zip Windows%20build'
- name: Upload Build
if: steps.upload-ndi.conclusion == 'skipped' && steps.upload-release.conclusion == 'skipped'
uses: actions/upload-artifact@v1
with:
name: UltraGrid CI Windows build
path: build
# vi: set expandtab sw=2: