mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-08 19:32:39 +08:00
240 lines
12 KiB
YAML
240 lines
12 KiB
YAML
name: Visual Studio builds for WinXP
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
MSBuild_XP_CI_build:
|
|
permissions:
|
|
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
|
|
contents: write # for actions/checkout to fetch code and softprops/action-gh-release
|
|
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
shell: pwsh
|
|
steps:
|
|
- name: Cancel previous runs
|
|
uses: styfle/cancel-workflow-action@0.11.0
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
- uses: actions/checkout@v4
|
|
- uses: microsoft/setup-msbuild@v1.3
|
|
- name: Prepare Visual Studio build for WinXP
|
|
shell: bash
|
|
run: |
|
|
echo "timestamp=`git show -s --format=%at | xargs -I# date -d @# +%Y%m%d%H%M%S`" >> $GITHUB_ENV
|
|
ls -1 vs/dosbox-x.vcxproj vs/freetype/builds/windows/vc2010/freetype.vcxproj vs/libpdcurses/libpdcurses.vcxproj vs/libpng/projects/vstudio/libpng/libpng.vcxproj vs/libpng/projects/vstudio/libpng/libpng.vcxproj vs/sdl/VisualC/SDL/SDL.vcxproj vs/sdl/VisualC/SDLmain/SDLmain.vcxproj vs/sdl2/VisualC/SDL/SDL.vcxproj vs/sdl2/VisualC/SDLmain/SDLmain.vcxproj vs/sdlnet/VisualC/SDL_net_VS2008.vcxproj vs/sdlnet/VisualC/SDL_net_VS2008.vcxproj vs/zlib/zlib/zlib.vcxproj | xargs sed -b -i 's/v14[2-9]/v141/g;s/>10.0</>10.0.22000.0</g'
|
|
echo "timestamp=`git show -s --format=%at | xargs -I# date -d @# +%Y%m%d%H%M%S`" >> $GITHUB_ENV
|
|
export shortsha=`echo ${GITHUB_SHA} | cut -c1-7`
|
|
export copyrightyear=`git show -s --format=%at | xargs -I# date -d @# +'%Y'`
|
|
export updatestr=`git show -s --format=%at | xargs -I# date -d @# +'%b %d, %Y %I:%M:%S%P'`
|
|
echo '/* auto generated */' > include/build_timestamp.h
|
|
echo "#define UPDATED_STR \"${updatestr}\"" >> include/build_timestamp.h
|
|
echo "#define GIT_COMMIT_HASH \"${shortsha}\"" >> include/build_timestamp.h
|
|
echo "#define COPYRIGHT_END_YEAR \"${copyrightyear}\"" >> include/build_timestamp.h
|
|
cat include/build_timestamp.h
|
|
- name: Build Visual Studio Win32 SDL1
|
|
shell: pwsh
|
|
run: |
|
|
msbuild -m vs/dosbox-x.sln -t:dosbox-x:Rebuild -p:Configuration=Release -p:Platform=Win32
|
|
if (-not(Test-Path -Path bin\Win32\Release\dosbox-x.exe -PathType Leaf)) {exit 1}
|
|
contrib\windows\installer\PatchPE.exe bin\Win32\Release\dosbox-x.exe
|
|
- name: Build Visual Studio Win32 SDL2
|
|
shell: pwsh
|
|
run: |
|
|
msbuild -m vs/dosbox-x.sln -t:dosbox-x:Rebuild -p:Configuration="Release SDL2" -p:Platform=Win32
|
|
if (-not(Test-Path -Path bin\Win32\"Release SDL2"\dosbox-x.exe -PathType Leaf)) {exit 1}
|
|
contrib\windows\installer\PatchPE.exe bin\Win32\"Release SDL2"\dosbox-x.exe
|
|
- name: Build Visual Studio Win64 SDL1
|
|
shell: pwsh
|
|
run: |
|
|
msbuild -m vs/dosbox-x.sln -t:dosbox-x:Rebuild -p:Configuration=Release -p:Platform=x64
|
|
if (-not(Test-Path -Path bin\x64\Release\dosbox-x.exe -PathType Leaf)) {exit 1}
|
|
contrib\windows\installer\PatchPE.exe bin\x64\Release\dosbox-x.exe
|
|
- name: Build Visual Studio Win64 SDL2
|
|
shell: pwsh
|
|
run: |
|
|
msbuild -m vs/dosbox-x.sln -t:dosbox-x:Rebuild -p:Configuration="Release SDL2" -p:Platform=x64
|
|
if (-not(Test-Path -Path bin\x64\"Release SDL2"\dosbox-x.exe -PathType Leaf)) {exit 1}
|
|
contrib\windows\installer\PatchPE.exe bin\x64\"Release SDL2"\dosbox-x.exe
|
|
- name: Package Visual Studio build for WinXP
|
|
shell: bash
|
|
run: |
|
|
top=`pwd`
|
|
#$top/bin/Win32/Release/dosbox-x.exe -tests -set waitonerror=false -set logfile=tests.log || (echo Unit test completed: failure && exit 1)
|
|
#cat tests.log
|
|
mkdir -p $top/package/drivez
|
|
mkdir -p $top/package/scripts
|
|
mkdir -p $top/package/shaders
|
|
mkdir -p $top/package/glshaders
|
|
mkdir -p $top/package/languages
|
|
mkdir -p $top/vs-bin
|
|
cp $top/bin/Win32/Release/dosbox-x.exe $top/package/dosbox-x_XPx86_SDL1.exe
|
|
cp $top/bin/Win32/"Release SDL2"/dosbox-x.exe $top/package/dosbox-x_XPx86_SDL2.exe
|
|
cp $top/bin/x64/Release/dosbox-x.exe $top/package/dosbox-x_XPx64_SDL1.exe
|
|
cp $top/bin/x64/"Release SDL2"/dosbox-x.exe $top/package/dosbox-x_XPx64_SDL2.exe
|
|
cp $top/bin/Win32/Release/dosbox-x.exe $top/vs-bin/dosbox-x_XPx86_SDL1.exe
|
|
cp $top/bin/Win32/"Release SDL2"/dosbox-x.exe $top/vs-bin/dosbox-x_XPx86_SDL2.exe
|
|
cp $top/bin/x64/Release/dosbox-x.exe $top/vs-bin/dosbox-x_XPx64_SDL1.exe
|
|
cp $top/bin/x64/"Release SDL2"/dosbox-x.exe $top/vs-bin/dosbox-x_XPx64_SDL2.exe
|
|
sed -e 's/^\(output[ ]*=[ ]*\)default$/\1ttf/;s/^\(windowposition[ ]*=\)[ ]*-/\1 /;s/^\(file access tries[ ]*=[ ]*\)0$/\13/;s/^\(printoutput[ ]*=[ ]*\)png$/\1printer/;s/\(drive data rate limit[ ]*=[ ]*\)-1$/\10/' $top/dosbox-x.reference.conf>$top/package/dosbox-x.conf
|
|
cp $top/CHANGELOG $top/package/CHANGELOG.txt
|
|
cp $top/dosbox-x.reference.conf $top/package/dosbox-x.reference.conf
|
|
cp $top/dosbox-x.reference.full.conf $top/package/dosbox-x.reference.full.conf
|
|
cp $top/contrib/windows/installer/readme.txt $top/package/README.txt
|
|
cp $top/contrib/windows/installer/inpout32.dll $top/package/inpout32.dll
|
|
cp $top/contrib/fonts/FREECG98.BMP $top/package/FREECG98.BMP
|
|
cp $top/contrib/fonts/wqy_1?pt.bdf $top/package/
|
|
cp $top/contrib/fonts/Nouveau_IBM.ttf $top/package/Nouveau_IBM.ttf
|
|
cp $top/contrib/fonts/SarasaGothicFixed.ttf $top/package/SarasaGothicFixed.ttf
|
|
cp $top/contrib/windows/installer/drivez_readme.txt $top/package/drivez/readme.txt
|
|
cp $top/contrib/windows/installer/windows_explorer_context_menu*.bat $top/package/scripts/
|
|
cp $top/contrib/windows/shaders/* $top/package/shaders/
|
|
cp $top/contrib/glshaders/* $top/package/glshaders/
|
|
cp $top/contrib/translations/*/*.lng $top/package/languages/
|
|
cp $top/COPYING $top/package/COPYING
|
|
'${{ github.workspace }}/vs/tool/zip.exe' -r -9 '${{ github.workspace }}/dosbox-x-vsbuild-XP-${{ env.timestamp }}.zip' '${{ github.workspace }}/package/*'
|
|
- name: Upload preview package
|
|
uses: actions/upload-artifact@v3.1.2
|
|
with:
|
|
name: dosbox-x-vsbuild-XP-${{ env.timestamp }}
|
|
path: ${{ github.workspace }}/package/
|
|
- name: Upload release package
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: dosbox-x-vsbuild-XP-${{ env.timestamp }}.zip
|
|
- name: Cache Visual Studio builds
|
|
uses: actions/cache/save@v3
|
|
with:
|
|
path: ${{ github.workspace }}/vs-bin
|
|
key: vs-bin-${{ github.sha }}
|
|
MinGW32_lowend_CI_build:
|
|
permissions:
|
|
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
|
|
contents: write # for actions/checkout to fetch code and softprops/action-gh-release
|
|
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
shell: msys2 {0}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: MINGW32
|
|
update: true
|
|
install: git make mingw-w64-i686-libtool autoconf automake
|
|
- name: Update build info
|
|
shell: bash
|
|
run: |
|
|
echo "timestamp=`git show -s --format=%at | xargs -I# date -d @# +%Y%m%d%H%M%S`" >> $GITHUB_ENV
|
|
export shortsha=`echo ${GITHUB_SHA} | cut -c1-7`
|
|
export copyrightyear=`git show -s --format=%at | xargs -I# date -d @# +'%Y'`
|
|
export updatestr=`git show -s --format=%at | xargs -I# date -d @# +'%b %d, %Y %I:%M:%S%P'`
|
|
echo '/* auto generated */' > include/build_timestamp.h
|
|
echo "#define UPDATED_STR \"${updatestr}\"" >> include/build_timestamp.h
|
|
echo "#define GIT_COMMIT_HASH \"${shortsha}\"" >> include/build_timestamp.h
|
|
echo "#define COPYRIGHT_END_YEAR \"${copyrightyear}\"" >> include/build_timestamp.h
|
|
cat include/build_timestamp.h
|
|
- name: setup lowend build environment
|
|
shell: bash
|
|
run: |
|
|
top=`pwd`
|
|
echo "${top}"
|
|
export "MSYSTEM_PREFIX=/d/a/_temp/msys64/mingw32"
|
|
echo "path=$PATH"
|
|
cd ${MSYSTEM_PREFIX}/..
|
|
ls -lg
|
|
rm -rf /d/a/_temp/msys64/mingw32
|
|
mkdir mingw32
|
|
7z x $top/build-scripts/mingw/lowend-bin/i686-7.3.0-release-posix-dwarf-rt_v5-rev0+nasm.7z -o${MSYSTEM_PREFIX}
|
|
cp $top/build-scripts/mingw/lowend-bin/make.exe ${MSYSTEM_PREFIX}/bin/make.exe
|
|
echo "MSYSTEM_PREFIX=${MSYSTEM_PREFIX}"
|
|
chmod +x ${MSYSTEM_PREFIX}/bin/*.*
|
|
chmod +x ${MSYSTEM_PREFIX}/i686-w64-mingw32/bin/*.*
|
|
chmod +x ${MSYSTEM_PREFIX}/opt/bin/*.*
|
|
- name: Build MinGW32 lowend SDL2
|
|
shell: bash
|
|
run: |
|
|
top=`pwd`
|
|
export "MSYSTEM_PREFIX=/d/a/_temp/msys64/mingw32"
|
|
./build-mingw-sdl2
|
|
strip -s src/dosbox-x.exe
|
|
mkdir -p mingw-bin
|
|
cp src/dosbox-x.exe mingw-bin/dosbox-x_mingw_lowend_SDL2.exe
|
|
- name: Build MinGW32 lowend SDL1
|
|
shell: bash
|
|
run: |
|
|
export "MSYSTEM_PREFIX=/d/a/_temp/msys64/mingw32"
|
|
./build-mingw
|
|
strip -s src/dosbox-x.exe
|
|
cp src/dosbox-x.exe mingw-bin/dosbox-x_mingw_lowend_SDL1.exe
|
|
- name: Cache MinGW32 lowend builds
|
|
uses: actions/cache/save@v3
|
|
with:
|
|
path: ${{ github.workspace }}/mingw-bin
|
|
key: mingw-bin-${{ github.sha }}
|
|
build-XP-installer:
|
|
permissions:
|
|
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
|
|
contents: write # for actions/checkout to fetch code and softprops/action-gh-release
|
|
runs-on: windows-latest
|
|
needs: [MSBuild_XP_CI_build, MinGW32_lowend_CI_build]
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Restore Visual Studio builds
|
|
uses: actions/cache/restore@v3
|
|
with:
|
|
path: ${{ github.workspace }}/vs-bin
|
|
key: vs-bin-${{ github.sha }}
|
|
- name: Restore MinGW builds
|
|
uses: actions/cache/restore@v3
|
|
with:
|
|
path: ${{ github.workspace }}/mingw-bin
|
|
key: mingw-bin-${{ github.sha }}
|
|
- name: Prepare files
|
|
shell: bash
|
|
run: |
|
|
echo "timestamp=`git show -s --format=%at | xargs -I# date -d @# +%Y%m%d%H%M%S`" >> $GITHUB_ENV
|
|
cp dosbox-*.conf contrib/windows/installer/
|
|
#ls -lg vs-bin
|
|
#ls -lg mingw-bin
|
|
mkdir -p contrib/windows/installer/WinXP
|
|
cp vs-bin/*.exe contrib/windows/installer/WinXP
|
|
cp mingw-bin/*.exe contrib/windows/installer/WinXP
|
|
#ls -lg contrib/windows/installer/WinXP
|
|
cd contrib/windows/installer/
|
|
./ISCC.exe ./DOSBox-X-setupXP.iss
|
|
- name: Upload preview installer
|
|
uses: actions/upload-artifact@v3.1.2
|
|
with:
|
|
name: dosbox-x-winXP-${{ env.timestamp }}-setup.exe
|
|
path: contrib/windows/installer/dosbox-x-winXP-*.exe
|
|
- name: Upload XP build installer release version
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
contrib/windows/installer/dosbox-x-winXP-*.exe
|
|
- name: Clean cache
|
|
run: |
|
|
gh extension install actions/gh-actions-cache
|
|
## need permission? disable the following lines if error occurs when deleting cache
|
|
set +e
|
|
gh actions-cache delete mingw-bin-${{ github.sha }} --confirm
|
|
gh actions-cache delete vs-bin-${{ github.sha }} --confirm
|
|
gh actions-cache list
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|