Skip to content

fix: resolve a crash caused by compatibility issues with the script A… #826

fix: resolve a crash caused by compatibility issues with the script A…

fix: resolve a crash caused by compatibility issues with the script A… #826

name: Windows (Portable)
on:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
permissions: read-all
jobs:
build:
runs-on: windows-2019
env:
WP_URL: https://github.com/winpython/winpython/releases/download/11.2.20241228final/Winpython64-3.12.8.0dot.exe
WP_SHA256: 2727f61b2702232337a46e39c006f24bd1084395cdf27d076c55d39756c406cc
WP_BINARY_DIR: WPy64-31280\python
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Conan
uses: actions/cache@v4
with:
path: ~/.conan2/p
key: ${{ runner.os }}-conan-Release-${{ hashFiles('conanfile.py') }}
restore-keys: |
${{ runner.os }}-conan-Release-
${{ runner.os }}-conan-
${{ runner.os }}-
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_64
- name: Set up CMake and Ninja
uses: lukka/get-cmake@latest
- name: Build wheels
uses: pypa/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CIBW_BUILD: cp312-win_amd64
CIBW_BUILD_VERBOSITY: 1
- name: Install Winpython
run: |
Invoke-WebRequest -OutFile winpython.exe ${{ env.WP_URL }}
$file_hash = (Get-FileHash winpython.exe ).Hash
if ($file_hash -ne "${{ env.WP_SHA256 }}") { exit(1) }
.\winpython.exe -y
- name: Install Endstone
shell: pwsh
run: |
$file = Get-ChildItem -Path .\wheelhouse -Filter *.whl | Select-Object -First 1
${{ env.WP_BINARY_DIR }}\python.exe -m pip install $file.FullName
- name: Clean Up
run: |
${{ env.WP_BINARY_DIR }}\python.exe -m pip install pyclean
${{ env.WP_BINARY_DIR }}\python.exe -m pyclean ${{ env.WP_BINARY_DIR }}
- name: Create Bundle
run: |
New-Item dist\endstone-win_amd64-portable\bin\python -ItemType Directory
Copy-Item -Path ${{ env.WP_BINARY_DIR }}\* -Destination dist\endstone-win_amd64-portable\bin\python -Recurse
Copy-Item -Path scripts\start.cmd -Destination dist\endstone-win_amd64-portable
Copy-Item -Path CHANGELOG.md -Destination dist\endstone-win_amd64-portable
Copy-Item -Path LICENSE -Destination dist\endstone-win_amd64-portable
- name: Create Zip
run: 7z a endstone-win_amd64-portable.zip .\dist\endstone-win_amd64-portable\*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: endstone-win_amd64-portable.zip
name: endstone-win_amd64-portable.zip
release:
if: contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ build ]
permissions:
id-token: write
contents: write
steps:
- name: Restore Artifacts
uses: actions/download-artifact@v4
with:
pattern: endstone-*
path: dist
merge-multiple: true
- name: Create a Release
uses: softprops/action-gh-release@v2
with:
files: dist/*