trigger action #18
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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dx-rollback | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| Build: | |
| name: ${{ matrix.config.name }} | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| #Linux-aarch64 | |
| - os: ubuntu-22.04 | |
| name: Linux-aarch64 | |
| other_linker_flags: '-L/usr/aarch64-linux-gnu/local/lib' | |
| arch: aarch64 | |
| output: libRemoteInput.so | |
| release: libremoteinput64.so.aarch64 | |
| #Linux-64 | |
| - os: ubuntu-latest | |
| name: Linux-64 | |
| other_linker_flags: '-m64' | |
| arch: x86_64 | |
| output: libRemoteInput.so | |
| release: libremoteinput64.so | |
| #MacOS-64 | |
| - os: macos-13 #macos-latest | |
| name: MacOS-64 | |
| other_linker_flags: '-m64' | |
| arch: x86_64 | |
| output: libRemoteInput.dylib | |
| release: libremoteinput64.dylib | |
| #MacOS-aarch64 | |
| - os: macos-latest | |
| name: MacOS-aarch64 | |
| other_linker_flags: '-m64' | |
| arch: aarch64 | |
| output: libRemoteInput.dylib | |
| release: libremoteinput64.dylib.aarch64 | |
| #Windows-32 | |
| - os: windows-latest | |
| name: Windows-32 | |
| other_linker_flags: '-m32' | |
| arch: i686 | |
| output: libRemoteInput.dll | |
| release: libremoteinput32.dll | |
| #Windows-64 | |
| - os: windows-latest | |
| name: Windows-64 | |
| other_linker_flags: '-m64' | |
| arch: x86_64 | |
| output: libRemoteInput.dll | |
| release: libremoteinput64.dll | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| if: matrix.config.name != 'Linux-aarch64' | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| #Linux-aarch64 | |
| - name: Update Sources - Linux-aarch64 | |
| if: matrix.config.name == 'Linux-aarch64' | |
| run: | | |
| #source_version=$(cat /etc/apt/sources.list | grep "main restricted" | head -1 | sed -e 's/.*com\/ //' -e 's/ main.*//') | |
| #echo "Found: ${ source_version }" | |
| sudo sed -Ei 's/^deb /deb \[arch=amd64\,i386\] /' /etc/apt/sources.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy main restricted" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy universe" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates universe" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy multiverse" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list | |
| sudo dpkg --add-architecture arm64 | |
| sudo apt-get update | |
| - name: Dependencies - Linux-aarch64 | |
| if: matrix.config.name == 'Linux-aarch64' | |
| run: | | |
| sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
| sudo apt-get install libprocps-dev:arm64 mesa-common-dev:arm64 libglu1-mesa:arm64 libglu1-mesa-dev:arm64 libgl1-mesa-glx:arm64 libgl1-mesa-dev:arm64 libglfw3-dev:arm64 cmake | |
| sudo apt-get install openjdk-11-jdk | |
| sudo apt-get install libpython3-dev:arm64 | |
| - name: CMake Generate Build Files - Linux-aarch64 | |
| if: matrix.config.name == 'Linux-aarch64' | |
| env: | |
| JAVA_HOME: '/usr/lib/jvm/java-11-openjdk-amd64' | |
| run: | | |
| cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles" | |
| - name: Build - Linux-aarch64 | |
| if: matrix.config.name == 'Linux-aarch64' | |
| env: | |
| JAVA_HOME: '/usr/lib/jvm/java-11-openjdk-amd64' | |
| run: | | |
| cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4 | |
| #Linux-64 | |
| - name: Dependencies - Linux-64 | |
| if: matrix.config.name == 'Linux-64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libproc2-dev mesa-common-dev libglu1-mesa libglu1-mesa-dev libgl1 libgl1-mesa-dev libpython3-dev clang cmake g++ | |
| - name: CMake Generate Build Files - Linux-64 | |
| if: matrix.config.name == 'Linux-64' | |
| run: | | |
| cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles" | |
| - name: Build - Linux-64 | |
| if: matrix.config.name == 'Linux-64' | |
| run: | | |
| cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4 | |
| #MacOS-64 | |
| - name: CMake Generate Build Files - MacOS-64 | |
| if: matrix.config.name == 'MacOS-64' | |
| run: | | |
| cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles" | |
| - name: Build - MacOS-64 | |
| if: matrix.config.name == 'MacOS-64' | |
| run: | | |
| cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4 | |
| #MacOS-aarch64 | |
| - name: CMake Generate Build Files - MacOS-aarch64 | |
| if: matrix.config.name == 'MacOS-aarch64' | |
| run: | | |
| cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles" | |
| - name: Build - MacOS-aarch64 | |
| if: matrix.config.name == 'MacOS-aarch64' | |
| run: | | |
| cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4 | |
| #Windows-32 | |
| - name: Dependencies - Windows-32 | |
| if: matrix.config.name == 'Windows-32' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW32 | |
| install: mingw-w64-i686-gcc mingw-w64-i686-clang mingw-w64-i686-python mingw-w64-i686-cmake make | |
| update: false | |
| - name: CMake Generate Build Files - Windows-32 | |
| if: matrix.config.name == 'Windows-32' | |
| shell: msys2 {0} | |
| run: | | |
| set MSYSTEM=MINGW32 | |
| MINGW_INSTALLS=MINGW32 | |
| cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles" | |
| - name: Build - Windows-32 | |
| if: matrix.config.name == 'Windows-32' | |
| shell: msys2 {0} | |
| run: | | |
| set MSYSTEM=MINGW32 | |
| MINGW_INSTALLS=MINGW32 | |
| cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4 | |
| #Windows-64 | |
| - name: Dependencies - Windows-64 | |
| if: matrix.config.name == 'Windows-64' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| install: mingw-w64-x86_64-gcc mingw-w64-x86_64-clang mingw-w64-x86_64-python mingw-w64-x86_64-cmake make | |
| update: false | |
| - name: CMake Generate Build Files - Windows-64 | |
| if: matrix.config.name == 'Windows-64' | |
| shell: msys2 {0} | |
| run: | | |
| set MSYSTEM=MINGW64 | |
| MINGW_INSTALLS=MINGW64 | |
| cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles" | |
| - name: Build - Windows-64 | |
| if: matrix.config.name == 'Windows-64' | |
| shell: msys2 {0} | |
| run: | | |
| set MSYSTEM=MINGW64 | |
| MINGW_INSTALLS=MINGW64 | |
| cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4 | |
| #Shared | |
| - name: Move Artifacts - ${{ matrix.config.name }} | |
| if: github.event_name == 'push' | |
| run: | | |
| mv '${{ github.workspace }}/cmake-build-release/${{ matrix.config.output }}' '${{ github.workspace }}/cmake-build-release/${{ matrix.config.release }}' | |
| - name: 'Upload Artifacts - ${{ matrix.config.name }}' | |
| if: github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| overwrite: true | |
| name: 'artifact-${{ matrix.config.name }}' | |
| path: '${{ github.workspace }}/cmake-build-release/${{ matrix.config.release }}' | |
| Release: | |
| runs-on: ubuntu-latest | |
| needs: [Build] | |
| if: github.event_name == 'push' && github.repository_owner == 'WaspScripts' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| ref: main | |
| - name: Set up Git | |
| run: | | |
| git config --global user.name "Wasp Bot" | |
| git config --global user.email "waspbot@waspcripts.com" | |
| - name: Get current date | |
| id: date | |
| run: | | |
| echo "CURRENT_YEAR=$(date +'%Y')" >> $GITHUB_ENV | |
| echo "CURRENT_MONTH=$(date +'%m')" >> $GITHUB_ENV | |
| echo "CURRENT_DAY=$(date +'%d')" >> $GITHUB_ENV | |
| - name: Get commit hash | |
| id: commit-hash | |
| run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: 'artifact-*' | |
| path: 'artifact' | |
| merge-multiple: true | |
| - name: List downloaded files | |
| run: ls -R artifact | |
| - name: Create version tag | |
| id: tag | |
| run: | | |
| TAG_NAME="$CURRENT_YEAR.$CURRENT_MONTH.$CURRENT_DAY-$COMMIT_HASH" | |
| echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | |
| git tag $TAG_NAME | |
| git push origin $TAG_NAME | |
| - name: Create GitHub release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "$TAG_NAME" \ | |
| --title "Release $TAG_NAME" \ | |
| --notes "Automated build from commit $COMMIT_HASH on branch $BRANCH_NAME" \ | |
| artifact/* |