-
Notifications
You must be signed in to change notification settings - Fork 79
134 lines (127 loc) · 4.27 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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
# 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@v3
with:
node-version: 16.x
- uses: actions/checkout@v3
- 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@v3
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@v3
- 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 }}