Skip to content

#111 Remodel GUI work and split between threads: Make DLL behave more… #301

#111 Remodel GUI work and split between threads: Make DLL behave more…

#111 Remodel GUI work and split between threads: Make DLL behave more… #301

Workflow file for this run

name: b2s-backglass
on:
push:
defaults:
run:
shell: bash
jobs:
build-server:
name: Build B2SServer-${{ matrix.config }}-win-${{ matrix.platform }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
include:
- platform: x86
config: Debug
- platform: x86
config: Release
steps:
- uses: actions/checkout@v4
# This empty uses is here on purpose
- uses: actions/checkout@v4
with:
repository: DirectOutput/B2SServerPluginInterface
path: B2SServerPluginInterface
- id: version
name: Update AssemblyInformationalVersion
run: |
SHA7="${GITHUB_SHA::7}"
: # Fetch version
VERSION_INFO="b2sbackglassserver/b2sbackglassserver/Classes/B2SVersionInfo.vb"
VERSION_MAJOR=$(grep -Eo "B2S_VERSION_MAJOR\s+=\s\"[0-9]+\"" "${VERSION_INFO}" | grep -Eo "[0-9]+" | tail -1)
VERSION_MINOR=$(grep -Eo "B2S_VERSION_MINOR\s+=\s\"[0-9]+\"" "${VERSION_INFO}" | grep -Eo "[0-9]+" | tail -1)
VERSION_REV=$(grep -Eo "B2S_VERSION_REVISION\s+=\s\"[0-9]+\"" "${VERSION_INFO}" | grep -Eo "[0-9]+" | tail -1)
VERSION_SHORT="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}.${{ github.run_number }}"
VERSION_LONG="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}.${{ github.run_number }}-${SHA7}"
echo VERSION_MINI ${VERSION_MINI}
echo VERSION_SHORT ${VERSION_SHORT}
echo VERSION_LONG ${VERSION_LONG}
: # b2sbackglassserver
perl -i -pe"s/B2S_VERSION_BUILD\s+=\s+\".*\"/B2S_VERSION_BUILD = \"${{ github.run_number }}\"/g" "${VERSION_INFO}"
perl -i -pe"s/B2S_VERSION_HASH\s+=\s+\".*\"/B2S_VERSION_HASH = \"${SHA7}\"/g" "${VERSION_INFO}"
ASSEMBLY_INFO="b2sbackglassserver/b2sbackglassserver/My Project/AssemblyInfo.vb"
perl -i -pe"s/AssemblyVersion\(\".*\"\)/AssemblyVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyFileVersion\(\".*\"\)/AssemblyFileVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyInformationalVersion\(\".*\"\)/AssemblyInformationalVersion\(\"${VERSION_LONG}\"\)/g" "${ASSEMBLY_INFO}"
: # b2s_screenresidentifier
ASSEMBLY_INFO="b2s_screenresidentifier/b2s_screenresidentifier/My Project/AssemblyInfo.vb"
perl -i -pe"s/AssemblyVersion\(\".*\"\)/AssemblyVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyFileVersion\(\".*\"\)/AssemblyFileVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyInformationalVersion\(\".*\"\)/AssemblyInformationalVersion\(\"${VERSION_LONG}\"\)/g" "${ASSEMBLY_INFO}"
: # b2sbackglassserverregisterapp
ASSEMBLY_INFO="b2sbackglassserverregisterapp/b2sbackglassserverregisterapp/My Project/AssemblyInfo.vb"
perl -i -pe"s/AssemblyVersion\(\".*\"\)/AssemblyVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyFileVersion\(\".*\"\)/AssemblyFileVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyInformationalVersion\(\".*\"\)/AssemblyInformationalVersion\(\"${VERSION_LONG}\"\)/g" "${ASSEMBLY_INFO}"
: # B2SWindowPunch
ASSEMBLY_INFO="B2SWindowPunch/B2SWindowPunch/Properties/AssemblyInfo.cs"
perl -i -pe"s/AssemblyVersion\(\".*\"\)/AssemblyVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyFileVersion\(\".*\"\)/AssemblyFileVersion\(\"${VERSION_SHORT}\"\)/g" "${ASSEMBLY_INFO}"
perl -i -pe"s/AssemblyInformationalVersion\(\".*\"\)/AssemblyInformationalVersion\(\"${VERSION_LONG}\"\)/g" "${ASSEMBLY_INFO}"
: # B2SServerPluginInterface
ASSEMBLY_INFO="B2SServerPluginInterface/B2SServerPluginInterface/Properties/AssemblyInfo.cs"
VERSION=$(grep -Eo "AssemblyVersion\(.*\)" "${ASSEMBLY_INFO}" | grep -Eo "[0-9\.]+" | tail -1)
TAG="${VERSION::5}.${{ github.run_number }}"
perl -i -pe"s/AssemblyConfiguration\(\"\"\)/AssemblyConfiguration\(\"Compiled by B2S.Server\"\)/g" "${ASSEMBLY_INFO}"
echo -e "\n[assembly: AssemblyFileVersion(\"${TAG}\")]" >> "${ASSEMBLY_INFO}"
echo -e "\n[assembly: AssemblyInformationalVersion(\"${TAG}-${SHA7}\")]" >> "${ASSEMBLY_INFO}"
: # Keep the VERSION_LONG for later
echo "tag=${VERSION_LONG}" >> $GITHUB_OUTPUT
- uses: microsoft/setup-msbuild@v2
- name: Build B2SServerPluginInterface
run: |
msbuild B2SServerPluginInterface/B2SServerPluginInterface.sln /t:Rebuild /p:Configuration=${{ matrix.config }}
shell: cmd
- run: |
cp B2SServerPluginInterface/B2SServerPluginInterface/bin/${{ matrix.config }}/B2SServerPluginInterface.dll b2sbackglassserver/b2sbackglassserver/Plugin
if [[ "${{ matrix.config }}" == "Debug" ]]; then
cp B2SServerPluginInterface/B2SServerPluginInterface/bin/${{ matrix.config }}/B2SServerPluginInterface.pdb b2sbackglassserver/b2sbackglassserver/Plugin
fi
- name: Build Server
run: |
msbuild b2s_screenresidentifier/B2S_ScreenResIdentifier.sln /t:Rebuild /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
msbuild b2sbackglassserver/B2SBackglassServerEXE.sln /t:Rebuild /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
msbuild b2sbackglassserverregisterapp/B2SBackglassServerRegisterApp.sln /t:Rebuild /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
msbuild b2sbackglassserver/B2SBackglassServer.sln /t:Rebuild /p:Configuration=${{ matrix.config }}
msbuild B2SWindowPunch/B2SWindowPunch.sln /t:Rebuild /p:Configuration=${{ matrix.config }}
shell: cmd
- name: Bundle
run: |
mkdir tmp
cp b2s_screenresidentifier/b2s_screenresidentifier/bin/${{ matrix.platform }}/${{ matrix.config }}/B2S_ScreenResIdentifier.exe tmp
cp b2s_screenresidentifier/b2s_screenresidentifier/bin/${{ matrix.platform }}/${{ matrix.config }}/B2S_ScreenResIdentifier.exe.config tmp
cp b2sbackglassserverregisterapp/b2sbackglassserverregisterapp/bin/${{ matrix.platform }}/${{ matrix.config }}/B2SBackglassServerRegisterApp.exe tmp
cp B2SServerPluginInterface/B2SServerPluginInterface/bin/${{ matrix.config }}/B2SServerPluginInterface.dll tmp
cp b2sbackglassserver/b2sbackglassserver/bin/${{ matrix.config }}/B2SBackglassServer.dll tmp
cp b2sbackglassserver/b2sbackglassserver/bin/${{ matrix.platform }}/${{ matrix.config }}/B2SBackglassServerEXE.exe tmp
cp b2sbackglassserver/b2sbackglassserver/bin/${{ matrix.platform }}/${{ matrix.config }}/B2SBackglassServerEXE.exe.config tmp
cp b2sbackglassserver/b2sbackglassserver/B2SInit.cmd tmp
cp B2SWindowPunch/B2SWindowPunch/bin/${{ matrix.config }}/B2SWindowPunch.exe tmp
if [[ "${{ matrix.config }}" == "Debug" ]]; then
cp b2s_screenresidentifier/b2s_screenresidentifier/bin/${{ matrix.platform }}/${{ matrix.config }}/B2S_ScreenResIdentifier.pdb tmp
cp b2sbackglassserverregisterapp/b2sbackglassserverregisterapp/bin/${{ matrix.platform }}/${{ matrix.config }}/B2SBackglassServerRegisterApp.pdb tmp
cp B2SServerPluginInterface/B2SServerPluginInterface/bin/${{ matrix.config }}/B2SServerPluginInterface.pdb tmp
cp b2sbackglassserver/b2sbackglassserver/bin/${{ matrix.config }}/B2SBackglassServer.pdb tmp
cp b2sbackglassserver/b2sbackglassserver/bin/${{ matrix.platform }}/${{ matrix.config }}/B2SBackglassServerEXE.pdb tmp
cp B2SWindowPunch/B2SWindowPunch/bin/${{ matrix.config }}/B2SWindowPunch.pdb tmp
fi
mkdir tmp/Plugins tmp/Plugins64
cp Plugins.txt tmp/Plugins
cp Plugins.txt tmp/Plugins64
cp Changelog.txt tmp
cp license.txt tmp
cp README.md tmp/README.txt
cp ScreenResTemplate.txt tmp
cp -r ScreenResTemplates tmp
cp -r B2STools tmp
cp b2sbackglassserverregisterapp/ScreenResTemplates.cmd tmp
- uses: actions/upload-artifact@v4
with:
name: B2SServer-${{ steps.version.outputs.tag }}-${{ matrix.config }}-win
path: tmp