Fix Linux support #176
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: 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/master' | |
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 |