Skip to content

Commit

Permalink
Create win-xp build
Browse files Browse the repository at this point in the history
  • Loading branch information
chchwy committed Nov 4, 2024
1 parent 7a0918f commit 680d55d
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 39 deletions.
89 changes: 89 additions & 0 deletions util/after-build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Param(
[string]$platform = "amd64", # amd64/x86
[string]$branch = "master", # branch names: master, release
[string]$upload = "no" # yes/no
)

echo ">>> Upload?", $upload
echo ">>> Branch:", $branch
echo ">>> Platform:", $platform

$arch = switch ($platform) {
"x86" {"win32"; break}
"amd64" {"win64"; break}
default {"Unknown"; break}
}

$libcrypto = switch ($platform) {
"x86" {"C:\OpenSSL-v111-Win32\bin\libcrypto-1_1.dll"; break}
"amd64" {"C:\OpenSSL-v111-Win64\bin\libcrypto-1_1-x64.dll"; break}
default {""; break}
}

$libssl = switch ($platform) {
"x86" {"C:\OpenSSL-v111-Win32\bin\libssl-1_1.dll"; break}
"amd64" {"C:\OpenSSL-v111-Win64\bin\libssl-1_1-x64.dll"; break}
default {""; break}
}

[string]$ffmpegFileName = "ffmpeg-$arch.zip"
[string]$ffmpegUrl = "https://github.com/pencil2d/pencil2d-deps/releases/download/ffmpge-v4.1.1/$ffmpegFileName"


echo $PSScriptRoot
cd $PSScriptRoot
cd ../build

echo ">>> Current working directory:"
Get-Location # print the current working directory

New-Item -ItemType 'directory' -Path './Pencil2D/plugins' -ErrorAction Continue

echo ">>> Downloading ffmpeg: $ffmpegUrl"

wget -Uri $ffmpegUrl -OutFile "$ffmpegFileName" -ErrorAction Stop
Expand-Archive -Path "$ffmpegFileName" -DestinationPath "./Pencil2D/plugins" -ErrorAction Stop

Copy-Item -Path "./app/release/pencil2d.exe" -Destination "./Pencil2D/pencil2d.exe"

echo ">>> Deploying Qt libraries"

& "windeployqt" @("Pencil2D/pencil2d.exe")

echo ">>> Copy OpenSSL DLLs"
Copy-Item $libcrypto -Destination "./Pencil2D"
Copy-Item $libssl -Destination "./Pencil2D"

echo ">>> Zipping bin folder"

Compress-Archive -Path "./Pencil2D" -DestinationPath "./Pencil2D.zip"

$today = Get-Date -Format "yyyy-MM-dd"
$zipFileName = "pencil2d-winxp.zip"

echo ">>> Zip filename: $zipFileName"
Rename-Item -Path "./Pencil2D.zip" -NewName $zipFileName

echo ">>> Zip ok?"
Test-Path $zipFileName

cd $PSScriptRoot

if ($upload -ne "yes") {
echo ">>> Done. No need to upload binaries."
exit 0
}

echo ">>> Upload to Google drive"

$python3 = if (Test-Path env:PYTHON) { "$env:PYTHON\python.exe" } else { "python.exe" }

$GDriveFolderId = switch($platform) {
"x86" {$env:WIN32_NIGHTLY_PARENT; break}
"amd64" {$env:WIN64_NIGHTLY_PARENT; break}
}

#$fullPath = Convert-Path "./$zipFileName"
# & $python3 @("nightly-build-upload.py", $GDriveFolderId, $fullPath)

echo ">>> Done!"
51 changes: 12 additions & 39 deletions util/appveyor-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,40 @@
clone_depth: 1

image:
- Visual Studio 2019
- Visual Studio 2013

platform:
- x86
- x64

skip_commits:
files:
- '*.md'
- docs/*
- util/appveyor-mingw.yml

init:
- ver
- echo %PLATFORM%

install:
- if %PLATFORM%==x86 call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
- if %PLATFORM%==x86 set qt=5.6\msvc2013
before_build:
- set QTDIR=C:\Qt\%qt%
- set PATH=%PATH%;%QTDIR%\bin
- qmake --version

build_script:
- cd
- md build
- cd build
- qmake "..\pencil2d.pro" CONFIG+=GIT CONFIG+=Release CONFIG+=PENCIL2D_NIGHTLY
# with an additional flag NO_TESTS
- qmake "..\pencil2d.pro" CONFIG+=GIT CONFIG+=Release CONFIG+=NO_TESTS CONFIG+=PENCIL2D_RELEASE CONFIG+=WIN_LEGACY VERSION=0.7.0
- nmake

after_build:
- windeployqt "%APPVEYOR_BUILD_FOLDER%\build\app\release\pencil2d.exe"

- set upload=yes
- tree /f /a
- powershell ..\util\after-build.ps1 -upload %upload% -platform x86 -branch %APPVEYOR_REPO_BRANCH%
test_script:
- echo "Running tests"
- tests\release\tests.exe

for:
- matrix:
only:
- image: Visual Studio 2019
install:
- if %PLATFORM%==x86 call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
- if %PLATFORM%==x64 call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
- if %PLATFORM%==x86 set qt=5.15\msvc2019
- if %PLATFORM%==x64 set qt=5.15\msvc2019_64
- matrix:
only:
- image: Visual Studio 2013
install:
- if %PLATFORM%==x86 call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
- if %PLATFORM%==x86 set qt=5.6\msvc2013
build_script:
- md build
- cd build
# with an additional flag NO_TESTS
- qmake "..\pencil2d.pro" CONFIG+=GIT CONFIG+=Release CONFIG+=PENCIL2D_NIGHTLY CONFIG+=NO_TESTS
- nmake
test_script:
- echo "No tests for VS2013"
- echo "No tests for VS2013"
- tree /f /a

matrix:
exclude:
- image: Visual Studio 2013
platform: x64
artifacts:
- path: build/pencil2d-winxp.zip

0 comments on commit 680d55d

Please sign in to comment.