usd docker to build bcu to avoid GLIBC version issue #26
Workflow file for this run
This file contains hidden or 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: BCU CI | |
| on: | |
| push: | |
| tags: | |
| - 'bcu_*' | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest, macos-latest] | |
| configuration: [Release] | |
| platform: ['x64'] | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.os == 'ubuntu-latest' && 'ubuntu:18.04' || null }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| if: matrix.os == 'ubuntu-latest' | |
| - name: Checkout code (Non-Ubuntu) | |
| uses: actions/checkout@v3 | |
| if: matrix.os != 'ubuntu-latest' | |
| # Initialize the sub-module | |
| - name: Initialize submodules | |
| run: git submodule update --init | |
| # Install dependencies | |
| - name: Install dependencies (Ubuntu 18.04) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| apt-get update | |
| apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| pkg-config \ | |
| libyaml-dev \ | |
| libftdi1-dev \ | |
| libusb-1.0-0-dev \ | |
| git | |
| - name: Install dependencies (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew reinstall pkgconfig | |
| export PATH="/usr/local/Cellar/pkg-config/0.29.2_3/bin:${PATH}" | |
| brew reinstall libyaml | |
| brew install libftdi | |
| pkg-config --list-all | |
| - name: Create env variables (Linux/macOS) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| echo "CI_BUILD_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
| - name: Create env variables (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| echo "CI_BUILD_VERSION=${{ github.ref_name }}" >> $env:GITHUB_ENV | |
| # Build Project | |
| - name: Build (Linux/macOS) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| echo $CI_BUILD_VERSION | |
| if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
| cmake . | |
| elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
| export PATH="/usr/local/Cellar/pkg-config/0.29.2_3/bin:${PATH}" | |
| cmake . | |
| fi | |
| make | |
| # Windows build | |
| - name: Windows setup selection | |
| uses: microsoft/setup-msbuild@v1.1 | |
| if: matrix.os == 'windows-latest' | |
| - name: Build step2 (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| echo $env.CI_BUILD_VERSION | |
| msbuild /p:Configuration=${{ matrix.configuration }} /p:PlatformToolset=v143 /p:Platform=${{ matrix.platform }} Board_Control_Utilities.sln | |
| - name: Copy Board_Control_Utilities.exe to bcu.exe | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| if (Test-Path "${{ github.workspace }}\x64\Release\Board_Control_Utilities.exe") { | |
| Copy-Item "${{ github.workspace }}\x64\Release\Board_Control_Utilities.exe" "${{ github.workspace }}\bcu.exe" | |
| } | |
| - name: Upload artifact (Ubuntu) | |
| uses: actions/upload-artifact@v2 | |
| if: matrix.os == 'ubuntu-latest' | |
| with: | |
| name: bcu-artifacts-${{ github.run_id }}-${{ matrix.os }} | |
| path: | | |
| ${{ github.workspace }}/bcu | |
| - name: Upload artifact (Non-Ubuntu) | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.os != 'ubuntu-latest' | |
| with: | |
| name: bcu-artifacts-${{ github.run_id }}-${{ matrix.os }} | |
| path: | | |
| ${{ github.workspace }}/bcu.exe | |
| ${{ github.workspace }}/bcu_mac | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Check out the code | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Download build artifacts for all OS | |
| - name: Download artifacts (Ubuntu) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bcu-artifacts-${{ github.run_id }}-ubuntu-latest | |
| path: artifacts/ubuntu-18.04 | |
| - name: Download artifacts (macOS) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bcu-artifacts-${{ github.run_id }}-macos-latest | |
| path: artifacts/macos-latest | |
| - name: Download artifacts (Windows) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bcu-artifacts-${{ github.run_id }}-windows-latest | |
| path: artifacts/windows-latest | |
| # GitHub Releases | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Prebuild for ${{ github.ref_name }} (Ubuntu 18.04 Compatible) | |
| body: | | |
| Prebuild for commit ${{ github.sha }} | |
| Commit message: ${{ github.event.head_commit.message }} | |
| **Note**: Linux binary built with Ubuntu 18.04 for better compatibility | |
| draft: true | |
| files: | | |
| artifacts/ubuntu-18.04/bcu | |
| artifacts/macos-latest/bcu_mac | |
| artifacts/windows-latest/bcu.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |