-
Notifications
You must be signed in to change notification settings - Fork 1
178 lines (146 loc) · 5.95 KB
/
build-test.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Build
on:
push:
branches: ["main", "develop"]
jobs:
build-windows:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
- name: Build Emulator Core
run: msbuild 'BitMagic.X16Emulator/X16Emulator/EmulatorCore/EmulatorCore.vcxproj' /p:configuration=Release /p:platform=x64
- name: Build Debugger
run: dotnet build 'BitMagic.X16Debugger/X16D/X16D.csproj' /p:configuration=Release --nologo
- name: Copy Core to Debugger
run : copy-item 'BitMagic.X16Emulator\X16Emulator\EmulatorCore\x64\Release\EmulatorCore.dll' -Destination 'BitMagic.X16Debugger\X16D\bin\Release\net6.0\EmulatorCore.dll'
- name: Build Emulator
run: dotnet build 'BitMagic.X16Emulator/X16E/X16E.csproj' /p:configuration=Release --nologo
- name: Copy Core to Emulator
run: copy-item 'BitMagic.X16Emulator\X16Emulator\EmulatorCore\x64\Release\EmulatorCore.dll' -Destination 'BitMagic.X16Emulator\X16E\bin\Release\net6.0\EmulatorCore.dll'
- name: Create Version File
run: |
echo "${{ github.sha }}" > BitMagic.X16Emulator/X16E/bin/Release/net6.0/version.txt
echo "${{ github.sha }}" > BitMagic.X16Debugger/X16D/bin/Release/net6.0/version.txt
- name: Save Core Artifacts
uses: actions/upload-artifact@v3
with:
name: EmulatorCore
path: BitMagic.X16Emulator\X16Emulator\EmulatorCore\x64\Release\core.obj
- name: Archive Emulator
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
filename: 'BitMagic-TheEmulator.Windows.zip'
directory: BitMagic.X16Emulator/X16E/bin/Release/net6.0
- name: Archive Debugger
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
filename: 'BitMagic-TheDebugger.Windows.zip'
directory: BitMagic.X16Debugger/X16D/bin/Release/net6.0
- name: Setup VS Dev
uses: seanmiddleditch/gha-setup-vsdevenv@v4
- name: Build MSI
working-directory: BitMagic.X16Emulator
run: devenv.com BitMagic.X16Emulator.sln /project X16ESetup\X16ESetup.vdproj /build "Release|x64"
- name: Save Emulator Setup Artifacts
uses: actions/upload-artifact@v3
with:
name: BitMagic-Setup
path: BitMagic.X16Emulator\X16ESetup\Release\X16ESetup.msi
- name: Save Emulator Artifacts
uses: actions/upload-artifact@v3
with:
name: BitMagic-TheEmulator
path: BitMagic.X16Emulator/X16E/bin/Release/net6.0/BitMagic-TheEmulator.Windows.zip
- name: Save Debugger Artifacts
uses: actions/upload-artifact@v3
with:
name: BitMagic-TheDebugger
path: BitMagic.X16Debugger/X16D/bin/Release/net6.0/BitMagic-TheDebugger.Windows.zip
build-linux:
needs: build-windows
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Copy artifacts
uses: actions/download-artifact@v3
with:
name: EmulatorCore
path: BitMagic.X16Emulator/X16Emulator/EmulatorCoreLinux
- name: Build Core Wrapper
working-directory: BitMagic.X16Emulator/X16Emulator/EmulatorCoreLinux
run: |
chmod +x build.sh
./build.sh
ls -l
- name: Copy Wrapper to Emulator
run: |
mkdir -p BitMagic.X16Emulator/X16Emulator/EmulatorCore/x64/Release
cp BitMagic.X16Emulator/X16Emulator/EmulatorCoreLinux/EmulatorCore.so BitMagic.X16Emulator/X16Emulator/EmulatorCore/x64/Release/.
- name: Build Debugger
run: dotnet build 'BitMagic.X16Debugger/X16D/X16D.csproj' /p:configuration=Release --nologo
- name: Copy Wrapper
run: |
cp BitMagic.X16Emulator/X16Emulator/EmulatorCoreLinux/EmulatorCore.so BitMagic.X16Debugger/X16D/bin/Release/net6.0/.
- name: Create Version File
run: |
echo "${{ github.sha }}" > BitMagic.X16Debugger/X16D/bin/Release/net6.0/version.txt
echo "${{ github.sha }}" > version.txt
- name: Archive Debugger
uses: thedoctor0/zip-release@0.7.1
with:
type: 'tar'
filename: '../../../../../BitMagic-TheDebugger.Linux.tar.gz'
directory: BitMagic.X16Debugger/X16D/bin/Release/net6.0
- name: Copy artifacts (Setup)
uses: actions/download-artifact@v3
with:
name: BitMagic-Setup
path: .
- name: Copy artifacts (Debugger)
uses: actions/download-artifact@v3
with:
name: BitMagic-TheDebugger
path: .
- name: Copy artifacts (Emulator)
uses: actions/download-artifact@v3
with:
name: BitMagic-TheEmulator
path: .
- name: Create Github Release
uses: "marvinpinto/action-automatic-releases@latest"
if: github.ref == 'refs/heads/main'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "latest"
title: "Release Build"
files: |
BitMagic-TheDebugger.Linux.tar.gz
BitMagic-TheEmulator.Windows.zip
BitMagic-TheDebugger.Windows.zip
X16ESetup.msi
version.txt
- name: Create Github Development Release
uses: "marvinpinto/action-automatic-releases@latest"
if: github.ref == 'refs/heads/develop'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "prerelease"
title: "Development Build"
files: |
BitMagic-TheDebugger.Linux.tar.gz
BitMagic-TheEmulator.Windows.zip
BitMagic-TheDebugger.Windows.zip
X16ESetup.msi
version.txt