-
Notifications
You must be signed in to change notification settings - Fork 92
221 lines (186 loc) · 5.8 KB
/
deploy-pypi.yml
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Github Deploy
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
build-distribution:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
check-latest: true
- name: Set up Python venv
run: |
python3 -m venv .venv
source .venv/bin/activate
python3 --version
python3 -m pip install --upgrade pip
- name: Install libegl1
run: |
sudo apt update && sudo apt install -y libegl1
- name: Install setuptools, wheel
run: |
python3 -m pip install setuptools wheel
- name: Install requirements.txt
run: |
python3 -m pip install -r requirements.txt
- name: Download latest asset files
run: |
python3 -m pip install requests
python3 Deploy.py --download
- name: Build a binary wheel and a source tarball
run: python3 setup.py sdist bdist_wheel
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: |
dist/*.tar.gz
dist/*.whl
publish-to-pypi:
name: >-
Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build-distribution
- deploy-binaries
runs-on: ubuntu-latest
environment:
name: deploy-pypi
url: https://pypi.org/p/Furious-GUI
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
deploy-binaries:
name: Deploy binaries on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, macos-13, macos-14]
env:
# Last PySide6 version that supports macOS 10.9 + Python 3.11
PYSIDE6_LEGACY_VERSION: "6.4.3"
PYSIDE6_TARGET_VERSION: "6.8.1"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
check-latest: true
- name: Set up Python venv
run: |
python3 -m venv .venv
if [ "$RUNNER_OS" == "macOS" ]; then
source .venv/bin/activate
elif [ "$RUNNER_OS" == "Windows" ]; then
.venv/Scripts/activate
else
echo "$RUNNER_OS not supported"
exit 1
fi
python3 --version
python3 -m pip install --upgrade pip
- name: Install macOS dependencies
run: |
brew install create-dmg
if: runner.os == 'macOS'
# Remove problematic brew libs if Intel Mac
- name: Remove problematic brew libs on Intel Mac
run: |
brew remove --force --ignore-dependencies openssl@3
brew cleanup openssl@3
if: runner.os == 'macOS' && runner.arch == 'X64'
- name: Install setuptools, wheel
run: |
python3 -m pip install setuptools wheel
- name: Install PySide6-Essentials
run: |
python3 -m pip install PySide6-Essentials==$PYSIDE6_TARGET_VERSION
- name: Install requirements.txt
run: |
python3 -m pip install -r requirements.txt
- name: Install numpy<2
run: |
python3 -m pip install "numpy<2"
- name: Install nuitka, imageio
run: |
python3 -m pip install nuitka imageio
- name: Set up go 1.20
uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true
- name: Install go 1.20 dependencies
run: |
go version
python3 -m pip install "hysteria > 1.3.5"
- name: Set up go 1.23
uses: actions/setup-go@v4
with:
go-version: "1.23"
check-latest: true
- name: Install go 1.23 dependencies
run: |
go version
python3 -m pip install "Xray-core >= 1.8.8" "hysteria2 >= 2.0.4" "tun2socks > 2.5.2"
- name: Download latest asset files
run: |
python3 -m pip install requests
python3 Deploy.py --download
- name: Run deploy script
run: python3 Deploy.py
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: binary-distributions
path: |
*.zip
*.dmg
github-release:
name: >-
Upload to GitHub Release
needs:
- deploy-binaries
- publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: binary-distributions
path: dist/
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
--prerelease
--generate-notes
--title 'Furious ${{ github.ref_name }}'
- name: Upload artifact to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'