-
-
Notifications
You must be signed in to change notification settings - Fork 88
170 lines (144 loc) · 4.98 KB
/
Copy pathwheel.yml
File metadata and controls
170 lines (144 loc) · 4.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Wheel
on:
workflow_dispatch:
push:
branches:
- main
- stable
- v*
tags:
- 'v*'
permissions:
contents: read
concurrency:
group: wheel-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
jobs:
build_wheels:
name: Build Wheel (${{ matrix.python-tag }}-${{ matrix.platform }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-2022 ]
python-tag: [ "cp310", "cp311", "cp312", "cp313", "cp314" ]
include:
- os: ubuntu-latest
platform: manylinux_x86_64
- os: windows-2022
platform: win_amd64
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: Set up Conan
uses: ./.github/actions/setup-conan
with:
build-type: RelWithDebInfo
install-dependencies: 'false'
- name: Set up MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_64
- name: Set up CMake and Ninja
uses: lukka/get-cmake@latest
- name: Set Conan Home (Linux)
if: runner.os == 'Linux'
run: echo "CONAN_HOME=/host${HOME}/.conan2" >> $GITHUB_ENV
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CIBW_BUILD: ${{ matrix.python-tag }}-${{ matrix.platform }}
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT_PASS_LINUX: "CONAN_HOME SENTRY_AUTH_TOKEN"
- name: Change permission for Conan home folder (Linux)
if: runner.os == 'Linux'
run: sudo chown -R $USER:$USER ~/.conan2
- uses: actions/upload-artifact@v6
with:
name: endstone-wheels-${{ matrix.python-tag }}-${{ matrix.platform }}
path: ./wheelhouse/*.whl
portable:
name: Windows Portable
runs-on: windows-2022
needs: [ build_wheels ]
env:
WP_URL: https://github.com/winpython/winpython/releases/download/17.2.20250920final/WinPython64-3.13.7.0dot.exe
WP_SHA256: 75001c40e8507db4c408f298ce8f49d483efb5ebfa9bdfb50a0509d31bd028f5
WP_BINARY_DIR: WPy64-31700\python
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
sparse-checkout: |
scripts/start.cmd
CHANGELOG.md
LICENSE
- name: Download Wheel Artifact
uses: actions/download-artifact@v8
with:
name: endstone-wheels-cp313-win_amd64
path: wheelhouse
- 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@v7
with:
name: endstone-win_amd64-portable
path: endstone-win_amd64-portable.zip
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ build_wheels, portable ]
environment: pypi
permissions:
id-token: write
contents: write
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@v8
with:
pattern: endstone-wheels-*
path: dist/wheels
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/wheels
- name: Download portable artifact
uses: actions/download-artifact@v8
with:
name: endstone-win_amd64-portable
path: dist/portable
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: dist/portable/*