update build.yml #93
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: 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} | |
- { os: macos-latest, target: darwin, platform: darwin-x64} | |
- { os: macos-latest, target: darwin, platform: darwin-arm64} | |
steps: | |
- name: Env | |
run: | | |
if [[ ${{ github.ref }} == refs/tags/* ]]; then | |
TAG=${{ github.ref }} | |
TAG=${TAG#refs/tags/} | |
echo echo "TAG=$TAG" >> $GITHUB_ENV | |
else | |
echo echo "TAG=DEV" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- uses: actions/checkout@v2 | |
- 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: | | |
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/ | |
- 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@v2 | |
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@v2 | |
- 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@v1 | |
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 }} |