Fixed various syntax errors #581
Workflow file for this run
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] | |
jobs: | |
build-windows: | |
name: build-windows | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
lfs: 'true' | |
fetch-depth: 0 | |
- name: Get all tags | |
run: | | |
git show-ref --tags | |
git log -40 | |
git describe | |
- name: Pre-install (Windows) | |
shell: pwsh | |
run: | | |
$thirdpartydir="$((Get-Item ..).FullName)\3rdparty" | |
mkdir $thirdpartydir | |
- name: Export GitHub Actions cache environment variables for vcpkg | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Install NSIS 8192-character limit override | |
shell: pwsh | |
run: | | |
$thirdpartydir="$((Get-Item ..\3rdparty).FullName)" | |
$zipfile="$thirdpartydir\nsis-8192-overrides.zip" | |
(New-Object System.Net.WebClient).DownloadFile( | |
"https://downloads.sourceforge.net/project/nsis/NSIS%203/3.09/nsis-3.09-strlen_8192.zip",$zipfile); | |
Write-Output "NSIS-8192-override: installing..." | |
Expand-Archive -Path $zipfile -DestinationPath "C:\Program Files (x86)\NSIS\" -Force | |
- name: Install thirdparty packages | |
shell: pwsh | |
run: scripts\install-3rdparty-full-win1064.ps1 | |
- name: Bootstrap vcpkg | |
shell: pwsh | |
run: vcpkg\bootstrap-vcpkg.bat | |
- name: Install Python packages (Windows) | |
shell: bash | |
run: | | |
./scripts/install-3rdparty-win1064.sh | |
pythonExecutable=`which python` | |
pythonRoot=`python -c "import sys ; print(sys.prefix)"` | |
pythonExecutable=`cygpath --windows "$pythonExecutable"` | |
echo "Python_ROOT_DIR=$pythonRoot" >> $GITHUB_ENV | |
echo "Python3_EXECUTABLE=$pythonExecutable" >> $GITHUB_ENV | |
- name: Print Path | |
shell: pwsh | |
run: | | |
$env:path -split ";" | |
- name: Build & Test | |
uses: ashutoshvarma/action-cmake-build@master | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
with: | |
build-dir: ${{ github.workspace }}/build | |
configure-options: -Wno-dev -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/installed -DPython3_EXECUTABLE=${{ env.Python3_EXECUTABLE }} -DOpenCV_ROOT=${{ env.OPENCV_DIR }} | |
build-type: Release | |
run-test: true | |
install-build: true | |
- name: Create installer | |
shell: bash | |
run: | | |
cpack --config build/CPackSourceConfig.cmake | |
cpack --config build/CPackConfig.cmake | |
ls -l build/package | |
- name: upload CTest output in case of failure | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-ctest-output | |
path: build/Testing/Temporary/LastTest.log | |
- name: Capture build folder as artifact | |
if: ${{ failure() }} | |
shell: bash | |
run: tar cfz build.tgz build | |
- name: Upload build folder | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-build-folder | |
path: build.tgz | |
- name: Capture installed folder as artifact | |
shell: bash | |
run: | | |
7z a cwipc_win1064_${{ github.ref_name }}.zip installed/ | |
- name: Upload installed folder | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cwipc_win1064_${{ github.ref_name }}.zip | |
path: cwipc_win1064_${{ github.ref_name }}.zip | |
- name: Upload nsis installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-installer.exe | |
path: build/package/*.exe | |
- name: Check what was created and installed | |
if: always() | |
shell: bash | |
run: | | |
ls -l /c | |
ls -l /c/tools | |
ls -l "/c/Program Files" | |
ls -l "/c/Program Files (x86)" | |
ls -l | |
ls -l .. | |
build-macos: | |
name: build-macos | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
lfs: 'true' | |
fetch-depth: 0 | |
- name: Get all tags | |
run: | | |
git show-ref --tags | |
git log -40 | |
git describe | |
- name: Install dependencies | |
shell: bash | |
run: ./scripts/install-3rdparty-osx1015.sh | |
- name: Build & Test | |
uses: ashutoshvarma/action-cmake-build@master | |
with: | |
build-dir: ${{ github.workspace }}/build | |
configure-options: -Wno-dev | |
run-test: true | |
install-build: true | |
install-options: --prefix ${{ github.workspace }}/installed | |
- name: Create installer | |
shell: bash | |
run: | | |
cpack --config build/CPackSourceConfig.cmake | |
cpack --config build/CPackConfig.cmake | |
ls -l build/package | |
- name: upload CTest output in case of failure | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-ctest-output | |
path: build/Testing/Temporary/LastTest.log | |
- name: Capture build folder as artifact | |
if: ${{ failure() }} | |
shell: bash | |
run: tar cfz build.tgz build | |
- name: Upload build folder | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-build-folder | |
path: build.tgz | |
- name: Capture installed folder as artifact | |
shell: bash | |
run: | | |
tar -c -v -f cwipc_osx1015_${{ github.ref_name }}.tgz -z -C installed . | |
ls -l | |
- name: Upload installed folder | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cwipc_osx1015_${{ github.ref_name }}.tgz | |
path: cwipc_osx1015_${{ github.ref_name }}.tgz | |
build-linux: | |
name: build-linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
lfs: 'true' | |
fetch-depth: 0 | |
- name: Get all tags | |
run: | | |
git show-ref --tags | |
git log -40 | |
git describe --debug | |
git describe --tags --debug | |
- name: Install dependencies | |
shell: bash | |
run: ./scripts/install-3rdparty-ubuntu2204.sh | |
- name: Build & Test | |
uses: ashutoshvarma/action-cmake-build@master | |
with: | |
build-dir: ${{ github.workspace }}/build | |
configure-options: -Wno-dev | |
run-test: true | |
install-build: true | |
install-options: --prefix ${{ github.workspace }}/installed | |
- name: Create installer | |
shell: bash | |
run: | | |
cpack --config build/CPackSourceConfig.cmake | |
cpack --config build/CPackConfig.cmake | |
ls -l build/package | |
- name: upload CTest output in case of failure | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-ctest-output | |
path: build/Testing/Temporary/LastTest.log | |
- name: Capture build folder as artifact | |
if: ${{ failure() }} | |
shell: bash | |
run: tar cfz build.tgz build | |
- name: Upload build folder | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-build-folder | |
path: build.tgz | |
- name: Capture installed folder as artifact | |
shell: bash | |
run: | | |
tar -c -v -f cwipc_ubuntu2204_${{ github.ref_name }}.tgz -z -C installed . | |
ls -l | |
- name: Upload installed folder | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cwipc_ubuntu2204_${{ github.ref_name }}.tgz | |
path: cwipc_ubuntu2204_${{ github.ref_name }}.tgz | |
- name: Upload debian package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: debian-package.deb | |
path: build/package/*.deb | |
- name: Upload cached git version | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cached-git-version | |
path: .cachedgitversion.txt | |
create-release: | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
name: create-release | |
runs-on: ubuntu-latest | |
needs: | |
- build-windows | |
- build-macos | |
- build-linux | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
lfs: 'true' | |
fetch-depth: 0 | |
- name: Get all tags | |
run: | | |
git show-ref --tags | |
git log -40 | |
git describe | |
- name: Download cached git version | |
uses: actions/download-artifact@v3 | |
with: | |
name: cached-git-version | |
path: . | |
- name: Create Assets and full sourcecode assets | |
shell: bash | |
run: | | |
mkdir ../Assets | |
tar -c -f ../Assets/${{ github.ref_name }}-complete.tar.gz --exclude-vcs . | |
zip -x '*.git*' -r ../Assets/${{ github.ref_name }}-complete.zip . | |
awk '/^## /{if(flag){exit}; flag=1} flag' CHANGELOG.md > ../Assets/changes.md | |
- name: Download Windows installed folder | |
uses: actions/download-artifact@v3 | |
with: | |
name: cwipc_win1064_${{ github.ref_name }}.zip | |
path: ../Assets/ | |
- name: Download MacOS installed folder | |
uses: actions/download-artifact@v3 | |
with: | |
name: cwipc_osx1015_${{ github.ref_name }}.tgz | |
path: ../Assets/ | |
- name: Download Linux installed folder | |
uses: actions/download-artifact@v3 | |
with: | |
name: cwipc_ubuntu2204_${{ github.ref_name }}.tgz | |
path: ../Assets/ | |
- name: Download debian package | |
uses: actions/download-artifact@v3 | |
with: | |
name: debian-package.deb | |
path: ../Assets/ | |
- name: Download Windows installer | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-installer.exe | |
path: ../Assets/ | |
- name: Find Artefact names | |
run: | | |
windows_exe_path=$(ls ../Assets/*.exe | head -n 1) | |
linux_deb_path=$(ls ../Assets/*.deb | head -n 1) | |
echo "windows_exe_path=${windows_exe_path}" >> $GITHUB_ENV | |
echo "linux_deb_path=${linux_deb_path}" >> $GITHUB_ENV | |
- name: Check what is there | |
shell: bash | |
run: ls -l . ../Assets | |
- name: Create Release | |
uses: actions/create-release@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
draft: false | |
prerelease: true | |
release_name: ${{ github.ref }} | |
tag_name: ${{ github.ref }} | |
body_path: ../Assets/changes.md | |
- name: Upload Windows installer | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.windows_exe_path }} | |
asset_name: cwipc-win1064-${{ github.ref_name }}.exe | |
asset_content_type: application/gzip | |
- name: Upload Debian package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.linux_deb_path }} | |
asset_name: cwipc-ubuntu2204-${{ github.ref_name }}.deb | |
asset_content_type: application/gzip | |
- name: Upload complete source (gzipped tar) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ../Assets/${{ github.ref_name }}-complete.tar.gz | |
asset_name: cwipc-${{ github.ref_name }}-source-including-submodules.tar.gz | |
asset_content_type: application/zip | |
- name: Upload complete source (zip) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ../Assets/${{ github.ref_name }}-complete.zip | |
asset_name: cwipc-${{ github.ref_name }}-source-including-submodules.zip | |
asset_content_type: application/zip | |
- name: Upload Windows installed folder | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ../Assets/cwipc_win1064_${{ github.ref_name }}.zip | |
asset_name: cwipc-win10-${{ github.ref_name }}-built.zip | |
asset_content_type: application/zip | |
- name: Upload MacOS installed folder | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ../Assets/cwipc_osx1015_${{ github.ref_name }}.tgz | |
asset_name: cwipc-macos1014-intel-${{ github.ref_name }}-built.tgz | |
asset_content_type: application/gzip | |
- name: Upload Linux installed folder | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ../Assets/cwipc_ubuntu2204_${{ github.ref_name }}.tgz | |
asset_name: cwipc-ubuntu2204-${{ github.ref_name }}-built.tgz | |
asset_content_type: application/gzip |