Files
UltraGrid/.github/workflows/ccpp.yml
2020-06-03 16:22:02 +02:00

240 lines
9.0 KiB
YAML

name: C/C++ CI
on:
push:
branches:
- master
- ndi-build
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:
retag-continuous:
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
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master'
with:
persist-credentials: true
- name: Retag continuous
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master'
run: |
git fetch --prune --unshallow --tags
git tag -f continuous
git push -f origin refs/tags/continuous:refs/tags/continuous
- name: Update Release
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master'
run: |
sudo apt install jq
URL=$(curl -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 -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: retag-continuous
runs-on: ubuntu-16.04
env:
appimage_key: ${{ secrets.appimage_key }}
sdk_pass: ${{ secrets.sdk_pass }}
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: bootstrap
run: .github/scripts/Linux/prepare.sh
- name: configure
run: "[ ${{ github.ref }} != refs/heads/ndi-build ] && NDI=-disable-ndi; ./autogen.sh --enable-qt --with-cuda-host-compiler=$CUDA_HOST_COMPILER --enable-plugins --with-live555=/usr/local $NDI"
- name: make
run: make -j4
- name: make check
run: make check
- name: make distcheck
run: make distcheck
- name: Create AppImage
run: APPIMAGE=`data/scripts/Linux-AppImage/create-appimage.sh` && mv $APPIMAGE UltraGrid-continuous-x86_64.AppImage
- name: Upload Build
if: github.repository != 'CESNET/UltraGrid' || (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/ndi-build')
uses: actions/upload-artifact@v1
with:
name: UltraGrid CI Linux build
path: UltraGrid-continuous-x86_64.AppImage
- name: Upload NDI Build
if: github.ref == 'refs/heads/ndi-build'
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: .github/scripts/upload-ndi-build.sh UltraGrid-continuous-x86_64.AppImage
- name: Upload Release Asset
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo apt install jq zsync
zsyncmake -C UltraGrid-continuous-x86_64.AppImage
.github/scripts/replace-asset.sh continuous UltraGrid-continuous-x86_64.AppImage.zsync application/x-zsync AppImage%20zsync
.github/scripts/replace-asset.sh continuous UltraGrid-continuous-x86_64.AppImage application/x-appimage Linux%20build
macOS:
name: run macOS
needs: retag-continuous
runs-on: macos-latest
env:
altool_pass: ${{ secrets.altool_pass }}
apple_key_p12_b64: ${{ secrets.apple_key_p12_b64 }}
sdk_pass: ${{ secrets.sdk_pass }}
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: bootstrap
run: .github/scripts/macOS/prepare.sh
- name: configure
run: "export ARCH=-msse4.2; [ ${{ github.ref }} != refs/heads/ndi-build ] && NDI=-disable-ndi; ./autogen.sh --enable-qt --with-live555=/usr/local $NDI"
- 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-continuous.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 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 Build
if: github.repository != 'CESNET/UltraGrid' || (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/ndi-build')
uses: actions/upload-artifact@v1
with:
name: UltraGrid CI macOS build
path: UltraGrid-continuous.dmg
- name: Upload Release Asset
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
brew install jq
.github/scripts/replace-asset.sh continuous UltraGrid-continuous.dmg application/x-apple-diskimage macOS%20build
Windows:
name: run Windows
needs: retag-continuous
runs-on: windows-latest
env:
MSYS2_PATH_TYPE: inherit
sdk_pass: ${{ secrets.sdk_pass }}
steps:
- uses: actions/checkout@v1
with:
submodules: false
- 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-2
- 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 (x86)\Jack'
key: cache-jack-2
- name: Install JACK
if: steps.cache-jack.outputs.cache-hit != 'true'
run: .github/scripts/Windows/install_jack.ps1
- name: Cache live555
id: cache-live555
uses: actions/cache@v1
with:
path: 'C:\live555'
key: cache-live555
- name: Build live555
env:
CC: gcc
CXX: g++
if: steps.cache-live555.outputs.cache-hit != 'true'
run: C:\msys64\usr\bin\bash -cel '$GITHUB_WORKSPACE/.github/scripts/Windows/build_live555.sh'
- name: bootsrap MSYS2
run: C:\msys64\usr\bin\bash -cel '$GITHUB_WORKSPACE/.github/scripts/Windows/prepare_msys.sh'
- name: configure
run: C:\msys64\usr\bin\bash -cel '[ ${{ github.ref }} != refs/heads/ndi-build ] && NDI=-disable-ndi; ./autogen.sh --enable-qt $NDI --with-live555=/usr/local'
- 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
IFS=\"|\"; for exe in bin/*exe; do for n in `data/scripts/get_dll_depends.sh \"$exe\" | tr \"\n\" \"|\"`; do cp \"$n\" bin; done; done
windeployqt bin/uv-qt.exe
cp data/update.ps1 bin
mkdir build
mv bin build/UltraGrid-continuous-win64'
- name: make dist-check
run: C:\msys64\usr\bin\bash -cel 'PATH=
/usr/bin/make distcheck TARGET=build/UltraGrid-continuous-win64/uv.exe GUI_EXE=build/UltraGrid-continuous-win64/uv-qt.exe'
- name: Upload Build
if: github.repository != 'CESNET/UltraGrid' || (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/ndi-build')
uses: actions/upload-artifact@v1
with:
name: UltraGrid CI Windows build
path: build
- name: Upload NDI Build
if: github.ref == 'refs/heads/ndi-build'
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: |
C:\msys64\usr\bin\bash -cel 'cd build; zip -9 -r UltraGrid-continuous-win64.zip UltraGrid-continuous-win64
$GITHUB_WORKSPACE/.github/scripts/upload-ndi-build.sh UltraGrid-continuous-win64.zip'
- name: Upload Release Asset
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
C:\msys64\usr\bin\bash -cel 'cd build; zip -9 -r UltraGrid-continuous-win64.zip UltraGrid-continuous-win64
$GITHUB_WORKSPACE/.github/scripts/replace-asset.sh continuous UltraGrid-continuous-win64.zip application/zip Windows%20build'
# vi: set expandtab sw=2: