@ -38,220 +38,220 @@ jobs:
runs-on : windows-latest
runs-on : windows-latest
steps:
steps:
- name : Print inputs
- name : Print inputs
shell : bash
shell : bash
run : |
run : |
echo "ref: ${{ github.event.inputs.ref }}"
echo "ref: ${{ github.event.inputs.ref }}"
echo "config: ${{ github.event.inputs.config }}"
echo "config: ${{ github.event.inputs.config }}"
echo "build_dir: ${{ github.event.inputs.build_dir }}"
echo "build_dir: ${{ github.event.inputs.build_dir }}"
- name : Checkout latest build and submodules
- name : Checkout latest build and submodules
uses : actions/checkout@v4
uses : actions/checkout@v4
if : github.event.inputs.ref == ''
if : github.event.inputs.ref == ''
with:
with:
submodules : recursive
submodules : recursive
- name : Checkout specific build and submodules
- name : Checkout specific build and submodules
uses : actions/checkout@v4
uses : actions/checkout@v4
if : github.event.inputs.ref != ''
if : github.event.inputs.ref != ''
with:
with:
ref : ${{ github.event.inputs.ref }}
ref : ${{ github.event.inputs.ref }}
submodules : recursive
submodules : recursive
- name : Add MSBuild to PATH
- name : Add MSBuild to PATH
uses : microsoft/setup-msbuild@v2
uses : microsoft/setup-msbuild@v2
- name : Declare some variables
- name : Declare some variables
id : vars
id : vars
shell : bash
shell : bash
run : |
run : |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name : Enable SimpleWindowSwitcher support for newer Windows SDKs
- name : Enable SimpleWindowSwitcher support for newer Windows SDKs
shell : cmd
shell : cmd
run : |
run : |
cd libs/sws
cd libs/sws
C:\msys64\usr\bin\wget.exe https://github.com/valinet/sws/commit/972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch
C:\msys64\usr\bin\wget.exe https://github.com/valinet/sws/commit/972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch
C:\msys64\usr\bin\dos2unix.exe 972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch
C:\msys64\usr\bin\dos2unix.exe 972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch
C:\msys64\usr\bin\dos2unix.exe SimpleWindowSwitcher/sws_def.h
C:\msys64\usr\bin\dos2unix.exe SimpleWindowSwitcher/sws_def.h
C:\msys64\usr\bin\patch.exe -N SimpleWindowSwitcher/sws_def.h 972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch
C:\msys64\usr\bin\patch.exe -N SimpleWindowSwitcher/sws_def.h 972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch
C:\msys64\usr\bin\unix2dos.exe SimpleWindowSwitcher/sws_def.h
C:\msys64\usr\bin\unix2dos.exe SimpleWindowSwitcher/sws_def.h
exit /b 0
exit /b 0
- name : Setup NuGet
- name : Setup NuGet
uses : nuget/setup-nuget@v2
uses : nuget/setup-nuget@v2
- name : Restore NuGet packages
- name : Restore NuGet packages
run : |
run : |
nuget restore ExplorerPatcher.sln
nuget restore ExplorerPatcher.sln
- name : Download ep_taskbar
# - name: Download ep_taskbar
uses : robinraju/release-downloader@v1
# uses: robinraju/release-downloader@v1
with:
# with:
repository : ExplorerPatcher/ep_taskbar_releases
# repository: ExplorerPatcher/ep_taskbar_releases
fileName : ep_taskbar.*.dll
# fileName: ep_taskbar.*.dll
latest : true
# latest: true
out-file-path : build/Release
# out-file-path: build/Release
# build/Release/ep_taskbar.*.amd64.dll -> build/Release/x64/ep_taskbar.*.dll
# build/Release/ep_taskbar.*.amd64.dll -> build/Release/x64/ep_taskbar.*.dll
# build/Release/ep_taskbar.*.arm64.dll -> build/Release/ARM64/ep_taskbar.*.dll
# build/Release/ep_taskbar.*.arm64.dll -> build/Release/ARM64/ep_taskbar.*.dll
- name : Move ep_taskbar
# - name: Move ep_taskbar
shell : bash
# shell: bash
run : |
# run: |
if ls build/Release/ep_taskbar.*.amd64.dll 1> /dev/null 2>&1; then
# if ls build/Release/ep_taskbar.*.amd64.dll 1> /dev/null 2>&1; then
mkdir -p build/Release/x64
# mkdir -p build/Release/x64
for file in build/Release/ep_taskbar.*.amd64.dll; do
# for file in build/Release/ep_taskbar.*.amd64.dll; do
mv "$file" "build/Release/x64/$(basename "$file" .amd64.dll).dll"
# mv "$file" "build/Release/x64/$(basename "$file" .amd64.dll).dll"
done
# done
fi
# fi
#
# if ls build/Release/ep_taskbar.*.arm64.dll 1> /dev/null 2>&1; then
# mkdir -p build/Release/ARM64
# for file in build/Release/ep_taskbar.*.arm64.dll; do
# mv "$file" "build/Release/ARM64/$(basename "$file" .arm64.dll).dll"
# done
# fi
if ls build/Release/ep_taskbar.*.arm64.dll 1> /dev/null 2>&1; then
- name : Build funchook amd64
mkdir -p build/Release/ARM64
shell : powershell
for file in build/Release/ep_taskbar.*.arm64.dll; do
run : |
mv "$file" "build/Release/ARM64/$(basename "$file" .arm64.dll).dll"
cd libs/funchook
done
md build
fi
cd build
cmake -G "Visual Studio 17 2022" -A x64 -DFUNCHOOK_CPU=x86 ..
(gc .\funchook-static.vcxproj) -replace '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>', '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>' | Out-File .\funchook-static.vcxproj
cmake --build . --config Release
- name : Build funchook amd64
- name : Build funchook ar m64
shell : powershell
shell : powershell
run : |
run : |
cd libs/funchook
cd libs/funchook
md build
md build-arm64
cd build
cd build-arm64
cmake -G "Visual Studio 17 2022" -A x64 -DFUNCHOOK_CPU=x86 ..
cmake -G "Visual Studio 17 2022" -A ARM64 -DFUNCHOOK_CPU=arm64 -DFUNCHOOK_DISASM=capstone -DFUNCHOOK_BUILD_TESTS=OFF ..
(gc .\funchook-static.vcxproj) -replace '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>', '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>' | Out-File .\funchook-static.vcxproj
(gc .\funchook-static.vcxproj) -replace '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>', '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>' | Out-File .\funchook-static.vcxproj
cmake --build . --config Release
cmake --build . --config Release
- name : Build funchook arm64
- name : Build EP IA-32
shell : powershell
if : github.event.inputs.config == ''
run : |
working-directory : ${{env.GITHUB_WORKSPACE}}
cd libs/funchook
run : |
md build-arm64
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=IA-32 ${{env.SOLUTION_FILE_PATH}}
cd build-arm64
cmake -G "Visual Studio 17 2022" -A ARM64 -DFUNCHOOK_CPU=arm64 -DFUNCHOOK_DISASM=capstone -DFUNCHOOK_BUILD_TESTS=OFF ..
(gc .\funchook-static.vcxproj) -replace '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>', '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>' | Out-File .\funchook-static.vcxproj
cmake --build . --config Release
- name : Build EP IA-32
- name : Build EP amd64
if : github.event.inputs.config == ''
if : github.event.inputs.config == ''
working-directory : ${{env.GITHUB_WORKSPACE}}
working-directory : ${{env.GITHUB_WORKSPACE}}
run : |
run : |
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=IA-32 ${{env.SOLUTION_FILE_PATH}}
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=amd64 ${{env.SOLUTION_FILE_PATH}}
- name : Build EP amd 64
- name : Build EP ar m64
if : github.event.inputs.config == ''
if : github.event.inputs.config == ''
working-directory : ${{env.GITHUB_WORKSPACE}}
working-directory : ${{env.GITHUB_WORKSPACE}}
run : |
run : |
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=amd64 ${{env.SOLUTION_FILE_PATH}}
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=arm64 /p:WithArm64XBinaries=true ${{env.SOLUTION_FILE_PATH}}
- name : Build EP arm64
- name : Build EP custom
if : github.event.inputs.config = = ''
if : github.event.inputs.config ! = ''
working-directory : ${{env.GITHUB_WORKSPACE}}
working-directory : ${{env.GITHUB_WORKSPACE}}
run : |
run : |
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=arm64 /p:WithArm64XBinaries=true ${{env.SOLUTION_FILE_PATH}}
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{ github.event.inputs.config }} ${{env.SOLUTION_FILE_PATH}}
- name : Build EP custom
- name : Create expected build directory
if : github.event.inputs.config != ''
if : github.event.inputs.build_dir != ''
working-directory : ${{env.GITHUB_WORKSPACE}}
shell : bash
run : |
run : |
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{ github.event.inputs.config }} ${{env.SOLUTION_FILE_PATH}}
mkdir build
cp -r ${{ github.event.inputs.build_dir }}/Release build/Release
- name : Create expected build directory
- name : Generate dxgi.dll
if : github.event.inputs.build_dir != ''
shell : bash
shell : bash
run : |
run : |
if [[ -f "build/Release/x64/ExplorerPatcher.amd64.dll" ]]; then cp build/Release/x64/ExplorerPatcher.amd64.dll build/Release/x64/dxgi.dll; fi
mkdir build
if [[ -f "build/Release/ARM64/ExplorerPatcher.arm64.dll" ]]; then cp build/Release/ARM64/ExplorerPatcher.arm64.dll build/Release/ARM64/dxgi.dll; fi
cp -r ${{ github.event.inputs.build_dir }}/Release build/Release
- name : Generate dxgi.dll
- name : Patch amd64 setup
shell : bash
shell : cmd
run : |
run : |
if [[ -f "build/Release/x64/ExplorerPatcher.amd64.dll" ]]; then cp build/Release/x64/ExplorerPatcher.amd64.dll build/Release/x64/dxgi.dll; fi
if exist "build\Release\x64\ExplorerPatcher.amd64.dll" (
if [[ -f "build/Release/ARM64/ExplorerPatcher.arm64.dll" ]]; then cp build/Release/ARM64/ExplorerPatcher.arm64.dll build/Release/ARM64/dxgi.dll; fi
"build\Release\x64\ep_setup_patch.exe" "build\Release\x64\ExplorerPatcher.amd64.dll" "build\Release\x64\ep_setup.exe"
)
exit /b 0
- name : Patch amd64 setup
- name : Patch ar m64 setup
shell : cmd
shell : cmd
run : |
run : |
if exist "build\Release\x64\ExplorerPatcher.amd 64.dll" (
if exist "build\Release\ARM64\ExplorerPatcher.arm 64.dll" (
"build\Release\x64\ep_setup_patch.exe" "build\Release\x64\ExplorerPatcher.amd64.dll" "build\Release\x 64\ep_setup.exe"
"build\Release\x64\ep_setup_patch.exe" "build\Release\ARM64\ExplorerPatcher.arm64.dll" "build\Release\ARM 64\ep_setup.exe"
)
)
exit /b 0
exit /b 0
- name : Patch arm64 setup
- name : Upload artifacts
shell : cmd
uses : actions/upload-artifact@v4
run : |
with:
if exist "build\Release\ARM64\ExplorerPatcher.arm64.dll" (
name : ep_bin_multi_${{ steps.vars.outputs.sha_short }}_${{ steps.vars.outputs.branch }}
"build\Release\x64\ep_setup_patch.exe" "build\Release\ARM64\ExplorerPatcher.arm64.dll" "build\Release\ARM64\ep_setup.exe"
path : |
)
build/Release/
exit /b 0
- name : Upload artifacts
# build/Release/x64/ep_setup.exe -> build/Release/ep_setup.exe
uses : actions/upload-artifact@v4
# build/Release/ARM64/ep_setup.exe -> build/Release/ep_setup.arm64.exe
with:
- name : Stage files for release
name : ep_bin_multi_${{ steps.vars.outputs.sha_short }}_${{ steps.vars.outputs.branch }}
if : github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
path : |
shell : bash
build/Release/
run : |
if [ -d "build/Release/x64" ] && ls build/Release/x64/ep_setup.exe 1> /dev/null 2>&1; then
cp build/Release/x64/ep_setup.exe build/Release/ep_setup.exe
fi
if [ -d "build/Release/ARM64" ] && ls build/Release/ARM64/ep_setup.exe 1> /dev/null 2>&1; then
cp build/Release/ARM64/ep_setup.exe build/Release/ep_setup.arm64.exe
fi
# build/Release/x64/ep_setup.exe -> build/Release/ep_setup.exe
- name : Generate release name
# build/Release/ARM64/ep_setup.exe -> build/Release/ep_setup.arm64.exe
shell : bash
- name : Stage files for release
working-directory : build/Release/x64
if : github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
if : github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
shell : bash
run : |
run : |
echo "data=$(./ep_generate_release_name.exe)" >> $GITHUB_OUTPUT
if [ -d "build/Release/x64" ] && ls build/Release/x64/ep_setup.exe 1> /dev/null 2>&1; then
id : release_name
cp build/Release/x64/ep_setup.exe build/Release/ep_setup.exe
fi
if [ -d "build/Release/ARM64" ] && ls build/Release/ARM64/ep_setup.exe 1> /dev/null 2>&1; then
cp build/Release/ARM64/ep_setup.exe build/Release/ep_setup.arm64.exe
fi
- name : Generate release name
- name : Generate release notes
shell : bash
shell : bash
working-directory : build/Release/x64
working-directory : build/Release/x64
if : github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
if : github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
run : |
run : |
echo "data=$(./ep_generate_release_name.exe)" >> $GITHUB_OUTPUT
echo "data<<EP_RELEASE_DESCRIPTION_DELIM" >> $GITHUB_OUTPUT
id : release_name
echo "$(./ep_generate_release_description.exe ${{ steps.vars.outputs.sha_short }} ${{ steps.vars.outputs.branch }} ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_OUTPUT
echo "EP_RELEASE_DESCRIPTION_DELIM" >> $GITHUB_OUTPUT
id : release_description
- name : Generate release notes
- name : Create/update release (valinet)
shell : bash
uses : softprops/action-gh-release@v2
working-directory : build/Release/x64
if : github.repository_owner == 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
if : github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
id : create_release
run : |
with:
echo "data<<EP_RELEASE_DESCRIPTION_DELIM" >> $GITHUB_OUTPUT
draft : false
echo "$(./ep_generate_release_description.exe ${{ steps.vars.outputs.sha_short }} ${{ steps.vars.outputs.branch }} ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_OUTPUT
prerelease : ${{ !startsWith(github.event.head_commit.message, 'rel_') }}
echo "EP_RELEASE_DESCRIPTION_DELIM" >> $GITHUB_OUTPUT
name : ${{ steps.release_name.outputs.data }}
id : release_description
tag_name : ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }}
body : ${{ steps.release_description.outputs.data }}
files : |
build/Release/ep_setup.exe
build/Release/ep_setup.arm64.exe
env:
GITHUB_TOKEN : ${{ secrets.PAT }}
- name : Create/update release (valinet)
- name : Create/update release (forks)
uses : softprops/action-gh-release@v2
uses : softprops/action-gh-release@v2
if : github.repository_owner == 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
if : github.repository_owner != 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
id : create_release
id : create_release_fork
with:
with:
draft : false
draft : false
prerelease : ${{ !startsWith(github.event.head_commit.message, 'rel_') }}
prerelease : ${{ !startsWith(github.event.head_commit.message, 'rel_') }}
name : ${{ steps.release_name.outputs.data }}
name : ${{ steps.release_name.outputs.data }}
tag_name : ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }}
tag_name : ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }}
body : ${{ steps.release_description.outputs.data }}
body : ${{ steps.release_description.outputs.data }}
files : |
files : |
build/Release/ep_setup.exe
build/Release/ep_setup.exe
build/Release/ep_setup.arm64.exe
build/Release/ep_setup.arm64.exe
env:
env:
GITHUB_TOKEN : ${{ secrets.PAT }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name : Create/update release (forks)
uses : softprops/action-gh-release@v2
if : github.repository_owner != 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == ''
id : create_release_fork
with:
draft : false
prerelease : ${{ !startsWith(github.event.head_commit.message, 'rel_') }}
name : ${{ steps.release_name.outputs.data }}
tag_name : ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }}
body : ${{ steps.release_description.outputs.data }}
files : |
build/Release/ep_setup.exe
build/Release/ep_setup.arm64.exe
env:
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}