整理构建代码

This commit is contained in:
星外之神 2022-05-21 19:18:34 +08:00
parent c6689eca7e
commit c118caf021

View File

@ -37,14 +37,27 @@ jobs:
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 pygame
echo y | pip install --no-python-version-warning --disable-pip-version-check ordered-set echo y | pip install --no-python-version-warning --disable-pip-version-check ordered-set
# 使用pyinstaller构建
- name: Build pypvz with pyinstaller
run: |
pyinstaller -F main.py -n pypvz-with-python${{ matrix.python_version }}-pyinstaller-x64.exe --distpath ./out --noconsole --add-data="resources;./resources" -i ./pypvz.ico
- name: Release the version built by pyinstaller
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: PyinstallerBuilds
artifacts: ./out/*pyinstaller*.exe
token: ${{ secrets.GITHUB_TOKEN }}
# 使用Nuitka构建
- name: Show nuitka version - name: Show nuitka version
run: | run: |
Get-ChildItem env: Get-ChildItem env:
python -m nuitka --version python -m nuitka --version
- name: Build pypvz package - name: Build pypvz with Nuitka
run: | run: |
pyinstaller -F main.py -n pypvz-with-python${{ matrix.python_version }}-pyinstaller-x64.exe --distpath ./out --noconsole --add-data="resources;./resources" -i ./pypvz.ico
echo y | python -m nuitka --standalone --onefile --show-progress --show-memory --output-dir=out --windows-icon-from-ico=pypvz.ico --include-data-dir=resources=resources --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\libvorbisfile-3.dll=libvorbisfile-3.dll --include-data-file=c:\hostedtoolcache\windows\python\${{ matrix.python_version }}*\x64\lib\site-packages\pygame\libvorbis-0.dll=libvorbis-0.dll --windows-disable-console main.py echo y | python -m nuitka --standalone --onefile --show-progress --show-memory --output-dir=out --windows-icon-from-ico=pypvz.ico --include-data-dir=resources=resources --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\libvorbisfile-3.dll=libvorbisfile-3.dll --include-data-file=c:\hostedtoolcache\windows\python\${{ matrix.python_version }}*\x64\lib\site-packages\pygame\libvorbis-0.dll=libvorbis-0.dll --windows-disable-console main.py
mv ./out/main.exe ./out/pypvz-with-python${{ matrix.python_version }}-nuitka-msvc-x64.exe mv ./out/main.exe ./out/pypvz-with-python${{ matrix.python_version }}-nuitka-msvc-x64.exe
@ -54,18 +67,8 @@ jobs:
with: with:
name: artifact-python-${{ matrix.python_version }} name: artifact-python-${{ matrix.python_version }}
path: ./out/*.dist path: ./out/*.dist
# release处发布单文件可执行版exe
- name: Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: PyinstallerBuilds
artifacts: ./out/*pyinstaller*.exe
token: ${{ secrets.GITHUB_TOKEN }}
# release处发布单文件可执行版exe - name: Release the version built by nuitka
- name: Release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
allowUpdates: true allowUpdates: true