Skip to content

Commit 6847ae1

Browse files
committed
Update deploy-pypi.yml
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
1 parent 104946b commit 6847ae1

File tree

1 file changed

+47
-88
lines changed

1 file changed

+47
-88
lines changed

.github/workflows/deploy-pypi.yml

Lines changed: 47 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -68,51 +68,28 @@ jobs:
6868
strategy:
6969
matrix:
7070
os: [ ubuntu-22.04, ubuntu-22.04-arm, windows-2022, macos-13, macos-14 ]
71-
python-version: [ "3.12", "3.13" ]
71+
python-version: [ "3.11", "3.13" ]
7272
exclude:
7373
- os: ubuntu-22.04
74-
python-version: "3.12"
74+
python-version: "3.11"
7575
- os: windows-2022
76-
python-version: "3.12"
76+
python-version: "3.11"
7777
- os: macos-13
78-
python-version: "3.12"
78+
python-version: "3.11"
7979
- os: macos-14
80-
python-version: "3.12"
80+
python-version: "3.11"
8181
- os: ubuntu-22.04-arm
8282
python-version: "3.13"
8383
include:
8484
- os: windows-2022
85-
tag: win7
85+
id: win7
8686
env:
8787
# Last PySide6 version that supports macOS 10.9 & Python 3.11
8888
PYSIDE6_LEGACY_VERSION: "6.4.3"
8989
PYSIDE6_TARGET_VERSION: "6.8.3"
9090
# PySide6 has Windows ARM64 build since 6.9.0
9191
PYSIDE6_LATEST_VERSION: "6.9.1"
9292
steps:
93-
- name: Set platform environment variables
94-
run: |
95-
echo "PYSIDE6_Windows_X64_TARGET_VERSION=$PYSIDE6_TARGET_VERSION" >> $GITHUB_ENV
96-
echo "PYSIDE6_Windows_ARM64_TARGET_VERSION=$PYSIDE6_LATEST_VERSION" >> $GITHUB_ENV
97-
echo "PYSIDE6_macOS_X64_TARGET_VERSION=$PYSIDE6_TARGET_VERSION" >> $GITHUB_ENV
98-
echo "PYSIDE6_macOS_ARM64_TARGET_VERSION=$PYSIDE6_TARGET_VERSION" >> $GITHUB_ENV
99-
echo "PYSIDE6_Linux_X64_TARGET_VERSION=$PYSIDE6_TARGET_VERSION" >> $GITHUB_ENV
100-
echo "PYSIDE6_Linux_ARM64_TARGET_VERSION=6.6.3.1" >> $GITHUB_ENV
101-
case "${{ runner.arch }}" in
102-
X64)
103-
echo "MAPPED_RUNNER_ARCH=x86_64" >> $GITHUB_ENV
104-
;;
105-
ARM64)
106-
echo "MAPPED_RUNNER_ARCH=aarch64" >> $GITHUB_ENV
107-
;;
108-
ARM)
109-
echo "MAPPED_RUNNER_ARCH=armv7" >> $GITHUB_ENV
110-
;;
111-
*)
112-
echo "Unknown arch: ${{ runner.arch }}"
113-
exit 1
114-
;;
115-
esac
11693
- uses: actions/checkout@v4
11794
- name: Install macOS dependencies
11895
run: |
@@ -128,99 +105,81 @@ jobs:
128105
- name: Install Linux dependencies
129106
run: |
130107
sudo apt update
131-
sudo apt install -y libxcb-cursor0
132-
sudo apt install -y qt6-base-dev
133-
sudo apt install -y patchelf ccache
108+
sudo apt install -y libxcb-cursor0 qt6-base-dev patchelf ccache
134109
echo "QMAKE=$(which qmake6)" >> $GITHUB_ENV
135-
echo "Mapped runner architecture is $MAPPED_RUNNER_ARCH"
110+
111+
if [ "$RUNNER_ARCH" == "X64" ]; then
112+
linuxdeploy_arch="x86_64"
113+
elif [ "$RUNNER_ARCH" == "ARM64" ]; then
114+
linuxdeploy_arch="aarch64"
115+
else
116+
echo "Unknown runner architecture: $RUNNER_ARCH"
117+
exit 1
118+
fi
119+
120+
echo "linuxdeploy architecture is $linuxdeploy_arch"
136121
mkdir .linuxdeploy-bin
137122
echo "$PWD/.linuxdeploy-bin" >> $GITHUB_PATH
138-
wget -P .linuxdeploy-bin https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-$MAPPED_RUNNER_ARCH.AppImage
139-
wget -P .linuxdeploy-bin https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/latest/download/linuxdeploy-plugin-qt-$MAPPED_RUNNER_ARCH.AppImage
140-
wget -P .linuxdeploy-bin https://github.com/AppImage/appimagetool/releases/latest/download/appimagetool-$MAPPED_RUNNER_ARCH.AppImage
123+
wget -P .linuxdeploy-bin https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-$linuxdeploy_arch.AppImage
124+
wget -P .linuxdeploy-bin https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/latest/download/linuxdeploy-plugin-qt-$linuxdeploy_arch.AppImage
125+
wget -P .linuxdeploy-bin https://github.com/AppImage/appimagetool/releases/latest/download/appimagetool-$linuxdeploy_arch.AppImage
141126
chmod +x .linuxdeploy-bin/*
142127
if: runner.os == 'Linux'
143128
- name: Set up Python for Windows7
144129
uses: LorenEteval/setup-python-win7@v1
145130
with:
146131
python-version: ${{ matrix.python-version }}
147-
if: matrix.tag == 'win7'
132+
if: matrix.id == 'win7'
148133
- name: Set up Python
149134
uses: actions/setup-python@v5
150135
with:
151136
python-version: ${{ matrix.python-version }}
152137
check-latest: true
153-
if: matrix.tag != 'win7'
154-
- name: Set up PySide6 for Win7
138+
if: matrix.id != 'win7'
139+
- name: Set up PySide6 for Windows7
140+
uses: LorenEteval/setup-pyside6-win7@v1
141+
with:
142+
pyside6-version: ${{ env.PYSIDE6_TARGET_VERSION }}
143+
if: matrix.id == 'win7'
144+
- name: Download Python dependencies & latest asset files
155145
run: |
156146
python -c "import sys; print(sys.version)"
157147
python -m pip install --upgrade pip
158148
python -m pip install setuptools wheel
159-
python -m pip install PySide6-Essentials==$PYSIDE6_TARGET_VERSION
160-
curl -L -o qt6_x64_to_run_on_windows7.7z https://github.com/crystalidea/qt6windows7/releases/download/v$PYSIDE6_TARGET_VERSION/qt6_x64_to_run_on_windows7.7z
161-
7z x qt6_x64_to_run_on_windows7.7z -oqt6_x64_to_run_on_windows7 -y
162-
cd qt6_x64_to_run_on_windows7
163-
mkdir plugins
164-
mv imageformats platforms styles plugins
165-
cd ..
166-
cp -r qt6_x64_to_run_on_windows7/* "$PYTHON_WIN7_HOME/Lib/site-packages/PySide6/"
167-
if: matrix.tag == 'win7'
168-
- name: Download Python dependencies & latest asset files
169-
run: |
170-
if [[ "${{ matrix.tag }}" != "win7" ]]; then
171-
python -c "import sys; print(sys.version)"
172-
python -m pip install --upgrade pip
173-
python -m pip install setuptools wheel
174-
fi
175149
if [ "$RUNNER_OS" == "Linux" ] && [ "$RUNNER_ARCH" == "ARM64" ]; then
176150
python -m pip install "numpy<2"
177-
elif [ "$RUNNER_OS" == "Windows" ] && [ "$RUNNER_ARCH" == "ARM64" ]; then
178-
python -m pip install "https://github.com/LorenEteval/numpy-2.2.4-cp313-win_arm64/releases/download/2.2.4/numpy-2.2.4-cp313-cp313-win_arm64.whl"
151+
python -m pip install PySide6-Essentials==6.5.3
152+
else
153+
python -m pip install PySide6-Essentials==$PYSIDE6_TARGET_VERSION
179154
fi
180-
python -m pip install PySide6-Essentials==$PYSIDE6_${{ runner.os }}_${{ runner.arch }}_TARGET_VERSION
181155
python -m pip install -r requirements.txt
182156
python -m pip install nuitka imageio
183157
python -m pip install requests
184158
python Deploy.py --download
185-
- name: Download LLVM ARM64 Clang toolchain
186-
# TODO: Need mingw-arm64 on Windows ARM64
187-
shell: pwsh
188-
run: |
189-
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.5/clang+llvm-20.1.5-aarch64-pc-windows-msvc.tar.xz" `
190-
-OutFile "clang+llvm-20.1.5-aarch64-pc-windows-msvc.tar.xz"
191-
$newPath = ($env:PATH -split ";" | Where-Object { $_ -notlike "C:\Program Files\LLVM\bin" }) -join ";"
192-
echo "PATH=$newPath" >> $env:GITHUB_ENV
193-
mkdir C:\llvm-aarch64
194-
tar -xf clang+llvm-20.1.5-aarch64-pc-windows-msvc.tar.xz -C C:\llvm-aarch64
195-
echo "C:\llvm-aarch64\clang+llvm-20.1.5-aarch64-pc-windows-msvc\bin" >> $env:GITHUB_PATH
196-
echo "CGO_ENABLED=1" >> $env:GITHUB_ENV
197-
echo "CC=clang" >> $env:GITHUB_ENV
198-
echo "CXX=clang++" >> $env:GITHUB_ENV
199-
if: runner.os == 'Windows' && runner.arch == 'ARM64'
200159
- name: Set up go
201160
uses: actions/setup-go@v4
202161
with:
203162
go-version: "1.24"
204163
check-latest: true
205-
if: matrix.tag != 'win7'
206-
- name: Set up go for Win7
207-
run: |
208-
curl -L -o go-for-win7-windows-amd64.zip https://github.com/XTLS/go-win7/releases/latest/download/go-for-win7-windows-amd64.zip
209-
7z x go-for-win7-windows-amd64.zip -ogo-for-win7-windows-amd64 -y
210-
echo "GOROOT=$PWD/go-for-win7-windows-amd64" >> $GITHUB_ENV
211-
echo "CGO_ENABLED=1" >> $GITHUB_ENV
212-
echo "WIN_VER_COMPATIBLE=windows" >> $GITHUB_ENV
213-
if: matrix.tag == 'win7'
164+
if: matrix.id != 'win7'
214165
- name: Install go dependencies
215166
run: |
216-
if [[ "${{ matrix.tag }}" == "win7" ]]; then
217-
export PATH=${GOROOT}/bin:$PATH
167+
if [[ "${{ matrix.id }}" == "win7" ]]; then
168+
go_name="go-for-win7-windows-amd64"
169+
go_file="${go_name}.zip"
170+
171+
curl -L -o ${go_file} https://github.com/XTLS/go-win7/releases/latest/download/${go_file}
172+
7z x ${go_file} -o${go_name} -y
173+
174+
export GOROOT="$PWD/${go_name}"
175+
export CGO_ENABLED=1
176+
export PATH="${GOROOT}/bin:$PATH"
177+
echo "WIN_VER_COMPATIBLE=windows" >> $GITHUB_ENV
218178
fi
219179
go version
220-
python -m pip install "Xray-core >= 1.8.8" "hysteria2 >= 2.0.4" "tun2socks > 2.5.2"
221-
if [[ "${{ matrix.tag }}" == "win7" ]]; then
222-
echo "GOROOT=" >> $GITHUB_ENV
223-
fi
180+
python -m pip install "Xray-core >= 1.8.8"
181+
python -m pip install "hysteria2 >= 2.0.4"
182+
python -m pip install "tun2socks > 2.5.2"
224183
- name: Set up go legacy
225184
uses: actions/setup-go@v4
226185
with:

0 commit comments

Comments
 (0)