Merge branch 'master' of github.com:EmmyLua/EmmyLuaDebugger #140
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: Emmy Debugger Core | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: windows-latest, target: windows, platform: win32-x64} | |
| - { os: windows-latest, target: windows, platform: win32-x86, cmake_arch: "-A Win32"} | |
| - { os: ubuntu-latest, target: linux, platform: linux-x64, zig_build: true} | |
| - { os: macos-latest, target: darwin, platform: darwin-x64} | |
| - { os: macos-latest, target: darwin, platform: darwin-arm64} | |
| steps: | |
| - name: Env | |
| # set TAG=DEV if not a tag | |
| run: | | |
| if [[ ${{ github.ref }} = refs/tags/* ]]; then | |
| export TAG=$(echo ${{ github.ref }} | sed -e "s/refs\/tags\///g") | |
| else | |
| export TAG=DEV | |
| fi | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - uses: actions/checkout@v4 | |
| - name: Build-windows | |
| if: startsWith(matrix.os, 'windows') | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake .. ${{ matrix.cmake_arch }} -G "Visual Studio 17 2022" -DCMAKE_USER_MAKE_RULES_OVERRIDE="${{ github.workspace }}/cmake/flags_override.cmake" -DEMMY_CORE_VERSION=${{env.TAG}} | |
| cmake --build . --config Release | |
| cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/ | |
| - name: Build-linux | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| if [[ "${{ matrix.zig_build }}" == "true" ]]; then | |
| sudo snap install zig --classic --beta | |
| mkdir -p build | |
| # 使用zig-build.cmake配置文件编译C++项目 | |
| cmake -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/zig-build.cmake -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}} | |
| cmake --build build --config Release | |
| cmake --install build --config Release --prefix ${{ github.workspace }}/artifact/ | |
| else | |
| mkdir build | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}} | |
| cmake --build . --config Release | |
| cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/ | |
| fi | |
| - name: Build-macosx | |
| if: startsWith(matrix.os, 'macos') | |
| run: | | |
| mkdir build | |
| cd build | |
| if [[ "${{ matrix.platform }}" = darwin-arm64 ]]; then | |
| cmake .. -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}} | |
| else | |
| cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}} | |
| fi | |
| cmake --build . --config Release | |
| cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/ | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }} | |
| path: ${{ github.workspace }}/artifact/bin | |
| upload-release: | |
| name: Upload Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [build] | |
| runs-on: [ubuntu-latest] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Download | |
| uses: actions/download-artifact@v4 | |
| - name: Display structure of downloaded files | |
| run: ls -R | |
| - name: zip win32-x64 | |
| uses: TheDoctor0/zip-release@master | |
| with: | |
| filename: win32-x64.zip | |
| directory: win32-x64 | |
| path: | | |
| EasyHook.dll | |
| emmy_core.dll | |
| emmy_hook.dll | |
| emmy_tool.exe | |
| - name: zip win32-x86 | |
| uses: TheDoctor0/zip-release@master | |
| with: | |
| filename: win32-x86.zip | |
| directory: win32-x86 | |
| path: | | |
| EasyHook.dll | |
| emmy_core.dll | |
| emmy_hook.dll | |
| emmy_tool.exe | |
| - name: zip linux-x64 | |
| uses: TheDoctor0/zip-release@master | |
| with: | |
| filename: linux-x64.zip | |
| directory: linux-x64 | |
| path: emmy_core.so | |
| - name: zip darwin-x64 | |
| uses: TheDoctor0/zip-release@master | |
| with: | |
| filename: darwin-x64.zip | |
| directory: darwin-x64 | |
| path: emmy_core.dylib | |
| - name: zip darwin-arm64 | |
| uses: TheDoctor0/zip-release@master | |
| with: | |
| filename: darwin-arm64.zip | |
| directory: darwin-arm64 | |
| path: emmy_core.dylib | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| name: EmmyLuaDebugger | |
| draft: false | |
| generate_release_notes: true | |
| files: | | |
| win32-x64/win32-x64.zip | |
| win32-x86/win32-x86.zip | |
| darwin-arm64/darwin-arm64.zip | |
| darwin-x64/darwin-x64.zip | |
| linux-x64/linux-x64.zip | |
| token: ${{ secrets.RELEASE }} |