Skip to content

Commit

Permalink
Port windows-compile-vs to PowerShell
Browse files Browse the repository at this point in the history
PS has way better documentation and there's way less weird confusing behaviour than in batch.
downside is that this is more difficult to run (requires changing execution policy) but that's a small price to pay for being significantly more maintainable.
  • Loading branch information
dktapps committed Nov 26, 2024
1 parent f003d91 commit ef7ccf8
Show file tree
Hide file tree
Showing 4 changed files with 594 additions and 479 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/main-pm-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,31 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install tools and dependencies
run: choco install wget --no-progress


- name: Prepare download cache
id: download-cache
uses: actions/cache@v4
with:
path: ./download_cache
key: windows-cache-${{ hashFiles('./windows-compile-vs.ps1') }}
restore-keys: windows-cache-

- name: Compile PHP
run: .\windows-compile-vs.bat
run: .\windows-compile-vs.ps1
env:
VS_EDITION: Enterprise
SOURCES_PATH: ${{ github.workspace }}\pocketmine-php-sdk
PM_VERSION_MAJOR: ${{ inputs.pm-version-major }}

- name: Rename artifacts
- name: Download VC++ Redistributable
run: |
#vs17 allows running anything from VS 2015-2022
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vc_redist.x64.exe -OutFile vc_redist.x64.exe
- name: Prepare artifacts
run: |
mkdir temp
Compress-Archive -Path .\bin -DestinationPath "PHP-Windows-x64-PM${{ inputs.pm-version-major }}.zip"
move php-debug-pack-*.zip temp/PHP-Windows-x64-PM${{ inputs.pm-version-major }}-debugging-symbols.zip
move php-*.zip temp/PHP-Windows-x64-PM${{ inputs.pm-version-major }}.zip
move temp\*.zip .
- name: Upload artifacts
Expand All @@ -161,7 +170,8 @@ jobs:
with:
name: Windows-PM${{ inputs.pm-version-major }}
path: |
PHP-Windows-x64*.zip
PHP-Windows-x64-PM${{ inputs.pm-version-major }}*.zip
compile.log
windows-compile-vs.bat
vc_redist.x64.exe
if-no-files-found: error
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
${{ github.workspace }}/Linux-PM*/*.tar.gz
${{ github.workspace }}/MacOS-*-PM*/*.tar.gz
${{ github.workspace }}/Windows-PM*/*.zip
${{ github.workspace }}/Windows-PM*/*.exe
makeLatest: ${{ github.ref_name == github.event.repository.default_branch }}
name: PHP ${{ steps.version.outputs.PHP_VERSION }} - Latest (${{ steps.date.outputs.DATE }})
tag: php-${{ steps.version.outputs.PHP_VERSION }}-latest
Expand All @@ -98,6 +99,7 @@ jobs:
${{ github.workspace }}/Linux-PM*/*.tar.gz
${{ github.workspace }}/MacOS-*-PM*/*.tar.gz
${{ github.workspace }}/Windows-PM*/*.zip
${{ github.workspace }}/Windows-PM*/*.exe
makeLatest: false
name: PHP ${{ steps.version.outputs.PHP_VERSION }} (Build ${{ github.run_number }})
tag: php-${{ steps.version.outputs.PHP_VERSION }}-build-${{ github.run_number }}
Expand Down
Loading

0 comments on commit ef7ccf8

Please sign in to comment.