diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d6dbb89..179116d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,319 +1,319 @@ -name: Altseed - -on: - push: - branches: [ master ] - tags: - - '*' - pull_request: - -jobs: - windows: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v3 - - name: Update Submodules - run: | - git submodule update --init --recursive - - name: Cache Core - uses: actions/cache@v3 - id: cache-core - env: - cache-name: cache-core - with: - path: Core/build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Core/**') }} - - name: Build CMake - if: steps.cache-core.outputs.cache-hit != 'true' - run: | - cd Core - mkdir build - cd build - cmake .. -A x64 -D USE_MSVC_RUNTIME_LIBRARY_DLL=OFF - cmake --build . --config Release - cmake --build . --config Debug - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 5.0.x - - name: Build - run: | - dotnet build Altseed2.sln --configuration CI - dotnet build Altseed2.sln --configuration Release - - name: Upload artifact - continue-on-error: true - uses: actions/upload-artifact@v1 - with: - name: test-windows - path: Build - - test: - runs-on: windows-2019 - needs: [windows] - steps: - - uses: actions/checkout@v3 - - name: Update Submodules - run: | - git submodule update --init - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 5.0.x - - name: Download Windows - uses: actions/download-artifact@v1 - with: - name: test-windows - - name: Test - run: | - cd test-windows/CI/net5.0 - ./TestForMacLinux.exe - - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: test-result - path: test-windows/CI/net5.0 - - - name: Compare tests - run: | - cd Scripts - python test_screenshot.py - - linux: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v3 - - name: Update Submodules - run: | - git submodule update --init --recursive - - name: Cache Core - uses: actions/cache@v3 - id: cache-core - env: - cache-name: cache-core - with: - path: Core/build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Core/**') }} - - - name: Install Vulkan - if: steps.cache-core.outputs.cache-hit != 'true' - run: | - wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - - sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-focal.list http://packages.lunarg.com/vulkan/lunarg-vulkan-focal.list - sudo apt update - sudo apt -y install vulkan-sdk libgraphite2-dev - - - name: Install harfbuzz - if: steps.cache-core.outputs.cache-hit != 'true' - run: | - wget https://github.com/harfbuzz/harfbuzz/releases/download/7.3.0/harfbuzz-7.3.0.tar.xz - tar Jxfv harfbuzz-7.3.0.tar.xz - cd harfbuzz-7.3.0 - sudo ./configure --prefix=/usr --with-gobject --with-graphite2 && - sudo make - sudo make install - cd .. - - - name: Install libs - if: steps.cache-core.outputs.cache-hit != 'true' - run: | - sudo apt -y install libx11-dev libxrandr-dev libxi-dev libxinerama-dev libxcursor-dev libudev-dev libx11-xcb-dev - sudo apt -y install libssl-dev - sudo apt -y install libglu1-mesa-dev mesa-common-dev - sudo apt -y install libpulse-dev - sudo apt -y install libgtk-3-dev - - - name: Build CMake - if: steps.cache-core.outputs.cache-hit != 'true' - run: | - cd Core - mkdir build - cd build - cmake .. - cmake --build . --config Release - - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 5.0.x - - name: Build - run: | - cp ./Core/build/RELEASE/libAltseed2_Core.so ./Core/build/DEBUG #PartsTreeSystemのビルドに必要 - dotnet build Altseed2.sln --configuration CI - dotnet build Altseed2.sln --configuration Release - - mv Build/CI/net5.0/libAltseed2_Core.so Build/CI/net5.0/libAltseed2_Core - mv Build/Release/net5.0/libAltseed2_Core.so Build/Release/net5.0/libAltseed2_Core - - name: Test - continue-on-error: true - run: | - cd Build/CI/net5.0 - dotnet TestForMacLinux.dll - - name: Upload artifact - continue-on-error: true - uses: actions/upload-artifact@v1 - with: - name: test-linux - path: Build - - macOS: - runs-on: macos-13 - - steps: - - uses: actions/checkout@v3 - - name: Update Submodules - run: | - git submodule update --init --recursive - - - name: Cache Core - uses: actions/cache@v3 - id: cache-core - env: - cache-name: cache-core - with: - path: Core/build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Core/**') }} - - - name: Setup CMake - if: steps.cache-core.outputs.cache-hit != 'true' - uses: jwlawson/actions-setup-cmake@v1.13 - with: - cmake-version: '3.26.x' - - - name: Build CMake - if: steps.cache-core.outputs.cache-hit != 'true' - run: | - cmake --version - cd Core - mkdir build - cd build - cmake .. -G "Xcode" - cmake --build . --config Release - cmake --build . --config Debug - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 5.0.x - - - name: Build - run: | - dotnet build Altseed2.sln --configuration Release - dotnet build Altseed2.sln --configuration CI - - name: Test - continue-on-error: true - run: | - cd Build/CI/net5.0 - dotnet TestForMacLinux.dll - - name: Upload artifact - continue-on-error: true - uses: actions/upload-artifact@v1 - with: - name: test-mac - path: Build - - merge: - runs-on: ubuntu-latest - needs: [windows, linux, macOS] - steps: - - uses: actions/checkout@v3 - - name: Update Submodules - run: | - git submodule update --init - - - name: Download Windows - uses: actions/download-artifact@v1 - with: - name: test-windows - - - name: Download macOS - uses: actions/download-artifact@v1 - with: - name: test-mac - - - name: Download Linux - uses: actions/download-artifact@v1 - with: - name: test-linux - - - name: Merge - run: | - mkdir Altseed2 - - cp Core/LICENSE Altseed2/ - cp test-windows/Release/Altseed2.xml Altseed2/. - cp test-windows/Release/net5.0/Altseed2.dll Altseed2/. - cp test-windows/Release/net5.0/PartsTreeSystem.dll Altseed2/. - - cp test-windows/Release/net5.0/Altseed2_Core.dll Altseed2/. - cp test-mac/Release/net5.0/libAltseed2_Core.dylib Altseed2/. - cp test-linux/Release/net5.0/libAltseed2_Core Altseed2/. - - mkdir Altseed2-Tools-LICENSE - cp Core/LICENSE Altseed2-Tools-LICENSE/LICENSE.txt - cat Nuget/license.tools.txt >> Altseed2-Tools-LICENSE/LICENSE.txt - - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: Altseed2-${{ github.sha }} - path: Altseed2 - - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: Altseed2-Tools-LICENSE - path: Altseed2-Tools-LICENSE - - - make_nuget: - runs-on: windows-2019 - needs: [merge] - steps: - - uses: actions/checkout@v3 - - - name: Download Altseed2 - uses: actions/download-artifact@v1 - with: - name: Altseed2-${{ github.sha }} - - - name: Download Altseed2-Tools-LICENSE - uses: actions/download-artifact@v1 - with: - name: Altseed2-Tools-LICENSE - - - name: Setup - run: | - wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -O nuget.exe - mkdir result/ - shell: powershell - - - name: Make Nuget Package (Altseed2) - run: | - mkdir package/ - mkdir package/licenses - cp Nuget/Altseed2.nuspec package/. - cp Altseed2-${{ github.sha }}/* package/. - cd package - mv LICENSE licenses/LICENSE.txt - ..\nuget.exe pack Altseed2.nuspec -OutputDirectory ../result - shell: powershell - - - name: Make Nuget Package (Altseed2.Tools) - run: | - cp Altseed2-${{ github.sha }}/Altseed2.dll Tool/Altseed2.Tools/. - cp Altseed2-${{ github.sha }}/PartsTreeSystem.dll Tool/Altseed2.Tools/. - cp Altseed2-${{ github.sha }}/*Altseed2_Core* Tool/Altseed2.Tools/. - - cp Altseed2-Tools-LICENSE/LICENSE.txt Tool/Altseed2.Tools/LICENSE.txt - - cd Tool/Altseed2.Tools - dotnet pack -c CI - cp Build/CI/Altseed2.Tools.*.nupkg ../../result/. - shell: powershell - - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: nuget - path: result +name: Altseed + +on: + push: + branches: [ master ] + tags: + - '*' + pull_request: + +jobs: + windows: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v3 + - name: Update Submodules + run: | + git submodule update --init --recursive + - name: Cache Core + uses: actions/cache@v3 + id: cache-core + env: + cache-name: cache-core + with: + path: Core/build + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Core/**') }} + - name: Build CMake + if: steps.cache-core.outputs.cache-hit != 'true' + run: | + cd Core + mkdir build + cd build + cmake .. -A x64 -D USE_MSVC_RUNTIME_LIBRARY_DLL=OFF + cmake --build . --config Release + cmake --build . --config Debug + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 5.0.x + - name: Build + run: | + dotnet build Altseed2.sln --configuration CI + dotnet build Altseed2.sln --configuration Release + - name: Upload artifact + continue-on-error: true + uses: actions/upload-artifact@v1 + with: + name: test-windows + path: Build + + test: + runs-on: windows-2019 + needs: [windows] + steps: + - uses: actions/checkout@v3 + - name: Update Submodules + run: | + git submodule update --init + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 5.0.x + - name: Download Windows + uses: actions/download-artifact@v4.1.7 + with: + name: test-windows + - name: Test + run: | + cd test-windows/CI/net5.0 + ./TestForMacLinux.exe + + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: test-result + path: test-windows/CI/net5.0 + + - name: Compare tests + run: | + cd Scripts + python test_screenshot.py + + linux: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + - name: Update Submodules + run: | + git submodule update --init --recursive + - name: Cache Core + uses: actions/cache@v3 + id: cache-core + env: + cache-name: cache-core + with: + path: Core/build + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Core/**') }} + + - name: Install Vulkan + if: steps.cache-core.outputs.cache-hit != 'true' + run: | + wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-focal.list http://packages.lunarg.com/vulkan/lunarg-vulkan-focal.list + sudo apt update + sudo apt -y install vulkan-sdk libgraphite2-dev + + - name: Install harfbuzz + if: steps.cache-core.outputs.cache-hit != 'true' + run: | + wget https://github.com/harfbuzz/harfbuzz/releases/download/7.3.0/harfbuzz-7.3.0.tar.xz + tar Jxfv harfbuzz-7.3.0.tar.xz + cd harfbuzz-7.3.0 + sudo ./configure --prefix=/usr --with-gobject --with-graphite2 && + sudo make + sudo make install + cd .. + + - name: Install libs + if: steps.cache-core.outputs.cache-hit != 'true' + run: | + sudo apt -y install libx11-dev libxrandr-dev libxi-dev libxinerama-dev libxcursor-dev libudev-dev libx11-xcb-dev + sudo apt -y install libssl-dev + sudo apt -y install libglu1-mesa-dev mesa-common-dev + sudo apt -y install libpulse-dev + sudo apt -y install libgtk-3-dev + + - name: Build CMake + if: steps.cache-core.outputs.cache-hit != 'true' + run: | + cd Core + mkdir build + cd build + cmake .. + cmake --build . --config Release + + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 5.0.x + - name: Build + run: | + cp ./Core/build/RELEASE/libAltseed2_Core.so ./Core/build/DEBUG #PartsTreeSystemのビルドに必要 + dotnet build Altseed2.sln --configuration CI + dotnet build Altseed2.sln --configuration Release + + mv Build/CI/net5.0/libAltseed2_Core.so Build/CI/net5.0/libAltseed2_Core + mv Build/Release/net5.0/libAltseed2_Core.so Build/Release/net5.0/libAltseed2_Core + - name: Test + continue-on-error: true + run: | + cd Build/CI/net5.0 + dotnet TestForMacLinux.dll + - name: Upload artifact + continue-on-error: true + uses: actions/upload-artifact@v1 + with: + name: test-linux + path: Build + + macOS: + runs-on: macos-13 + + steps: + - uses: actions/checkout@v3 + - name: Update Submodules + run: | + git submodule update --init --recursive + + - name: Cache Core + uses: actions/cache@v3 + id: cache-core + env: + cache-name: cache-core + with: + path: Core/build + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Core/**') }} + + - name: Setup CMake + if: steps.cache-core.outputs.cache-hit != 'true' + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: '3.26.x' + + - name: Build CMake + if: steps.cache-core.outputs.cache-hit != 'true' + run: | + cmake --version + cd Core + mkdir build + cd build + cmake .. -G "Xcode" + cmake --build . --config Release + cmake --build . --config Debug + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 5.0.x + + - name: Build + run: | + dotnet build Altseed2.sln --configuration Release + dotnet build Altseed2.sln --configuration CI + - name: Test + continue-on-error: true + run: | + cd Build/CI/net5.0 + dotnet TestForMacLinux.dll + - name: Upload artifact + continue-on-error: true + uses: actions/upload-artifact@v1 + with: + name: test-mac + path: Build + + merge: + runs-on: ubuntu-latest + needs: [windows, linux, macOS] + steps: + - uses: actions/checkout@v3 + - name: Update Submodules + run: | + git submodule update --init + + - name: Download Windows + uses: actions/download-artifact@v4.1.7 + with: + name: test-windows + + - name: Download macOS + uses: actions/download-artifact@v4.1.7 + with: + name: test-mac + + - name: Download Linux + uses: actions/download-artifact@v4.1.7 + with: + name: test-linux + + - name: Merge + run: | + mkdir Altseed2 + + cp Core/LICENSE Altseed2/ + cp test-windows/Release/Altseed2.xml Altseed2/. + cp test-windows/Release/net5.0/Altseed2.dll Altseed2/. + cp test-windows/Release/net5.0/PartsTreeSystem.dll Altseed2/. + + cp test-windows/Release/net5.0/Altseed2_Core.dll Altseed2/. + cp test-mac/Release/net5.0/libAltseed2_Core.dylib Altseed2/. + cp test-linux/Release/net5.0/libAltseed2_Core Altseed2/. + + mkdir Altseed2-Tools-LICENSE + cp Core/LICENSE Altseed2-Tools-LICENSE/LICENSE.txt + cat Nuget/license.tools.txt >> Altseed2-Tools-LICENSE/LICENSE.txt + + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: Altseed2-${{ github.sha }} + path: Altseed2 + + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: Altseed2-Tools-LICENSE + path: Altseed2-Tools-LICENSE + + + make_nuget: + runs-on: windows-2019 + needs: [merge] + steps: + - uses: actions/checkout@v3 + + - name: Download Altseed2 + uses: actions/download-artifact@v4.1.7 + with: + name: Altseed2-${{ github.sha }} + + - name: Download Altseed2-Tools-LICENSE + uses: actions/download-artifact@v4.1.7 + with: + name: Altseed2-Tools-LICENSE + + - name: Setup + run: | + wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -O nuget.exe + mkdir result/ + shell: powershell + + - name: Make Nuget Package (Altseed2) + run: | + mkdir package/ + mkdir package/licenses + cp Nuget/Altseed2.nuspec package/. + cp Altseed2-${{ github.sha }}/* package/. + cd package + mv LICENSE licenses/LICENSE.txt + ..\nuget.exe pack Altseed2.nuspec -OutputDirectory ../result + shell: powershell + + - name: Make Nuget Package (Altseed2.Tools) + run: | + cp Altseed2-${{ github.sha }}/Altseed2.dll Tool/Altseed2.Tools/. + cp Altseed2-${{ github.sha }}/PartsTreeSystem.dll Tool/Altseed2.Tools/. + cp Altseed2-${{ github.sha }}/*Altseed2_Core* Tool/Altseed2.Tools/. + + cp Altseed2-Tools-LICENSE/LICENSE.txt Tool/Altseed2.Tools/LICENSE.txt + + cd Tool/Altseed2.Tools + dotnet pack -c CI + cp Build/CI/Altseed2.Tools.*.nupkg ../../result/. + shell: powershell + + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: nuget + path: result