-
Notifications
You must be signed in to change notification settings - Fork 52
139 lines (121 loc) · 5.02 KB
/
build-pr.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
name: "Build for PR"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
jobs:
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python_version:
- "3.11"
name: Windows Python ${{ matrix.python_version }}
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
- name: Use Python ${{ matrix.python_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
- name: 🧳 Install dependencies
run: |
echo y | pip install --no-python-version-warning --disable-pip-version-check pyinstaller
echo y | pip install --no-python-version-warning --disable-pip-version-check nuitka
echo y | pip install --no-python-version-warning --disable-pip-version-check zstandard
echo y | pip install --no-python-version-warning --disable-pip-version-check pygame
echo y | pip install --no-python-version-warning --disable-pip-version-check ordered-set
# 使用pyinstaller构建
- name: Build pypvz with pyinstaller
run: |
pyinstaller -F pypvz.py `
-n pypvz-with-python${{ matrix.python_version }}-pyinstaller-x64.exe `
--distpath ./out `
--noconsole `
--add-data="resources;./resources" `
--add-data="pypvz-exec-logo.png;./pypvz-exec-logo.png" `
-i ./pypvz.ico
- name: Release the version built by pyinstaller
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: Dev.Version.Built.with.Pyinstaller
artifacts: ./out/*pyinstaller*.exe
token: ${{ secrets.GITHUB_TOKEN }}
# 使用Nuitka构建
- name: Show nuitka version
run: |
Get-ChildItem env:
python -m nuitka --version
- name: Build pypvz with Nuitka
run: |
echo y | python -m nuitka --standalone `
--onefile `
--show-progress `
--show-memory `
--output-dir=out `
--windows-icon-from-ico=pypvz.ico `
--include-data-file=c:\hostedtoolcache\windows\python\${{ matrix.python_version }}*\x64\lib\site-packages\pygame\libogg-0.dll=libogg-0.dll `
--include-data-file=c:\hostedtoolcache\windows\python\${{ matrix.python_version }}*\x64\lib\site-packages\pygame\libopus-0.dll=libopus-0.dll `
--include-data-file=c:\hostedtoolcache\windows\python\${{ matrix.python_version }}*\x64\lib\site-packages\pygame\libopusfile-0.dll=libopusfile-0.dll `
--include-data-file=c:\hostedtoolcache\windows\python\${{ matrix.python_version }}*\x64\lib\site-packages\pygame\libjpeg-9.dll=libjpeg-9.dll `
--include-data-dir=resources=resources `
--windows-disable-console `
-o pypvz-with-python${{ matrix.python_version }}-nuitka-windows-x64.exe `
pypvz.py
- name: Release the version built by nuitka
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: Dev
artifacts: ./out/*nuitka*.exe
token: ${{ secrets.GITHUB_TOKEN }}
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version:
- "3.11"
name: Ubuntu Python ${{ matrix.python_version }}
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 🐍 Use Python ${{ matrix.python_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
- name: 🧳 Install dependencies
run: |
sudo apt-get update
sudo apt-get install patchelf gdb ccache libfuse2 zstd tar
python -m pip install --no-python-version-warning --disable-pip-version-check zstandard appdirs ordered-set tqdm Jinja2
python -m pip install --no-python-version-warning --disable-pip-version-check nuitka
python -m pip install --no-python-version-warning --disable-pip-version-check pygame
# 使用Nuitka构建
- name: Show nuitka version
run: |
env
python -m nuitka --version
- name: Build pypvz with Nuitka
run: |
yes | python -m nuitka \
--onefile \
--standalone \
--include-data-dir=resources=resources \
--linux-onefile-icon=pypvz.png \
--static-libpython=no \
--remove-output \
-o pypvz-with-python${{ matrix.python_version }}-linux-x86_64.bin \
pypvz.py
- name: Release the version built by nuitka
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: Dev
artifacts: ./pypvz*-x86_64.*
token: ${{ secrets.GITHUB_TOKEN }}