build kleinanzeigen-bot-windows-amd64-uncompressed.exe

This commit is contained in:
sebthom
2024-03-11 23:02:12 +01:00
parent e75936da75
commit a8290500e7
2 changed files with 14 additions and 6 deletions

View File

@@ -84,7 +84,7 @@ jobs:
uses: vegardit/fast-apt-mirror.sh@v1 uses: vegardit/fast-apt-mirror.sh@v1
- name: Install Chromium Browser - name: "Install: Chromium Browser"
if: env.ACT == 'true' && startsWith(matrix.os, 'ubuntu') if: env.ACT == 'true' && startsWith(matrix.os, 'ubuntu')
run: | run: |
if ! hash google-chrome &>/dev/null; then if ! hash google-chrome &>/dev/null; then
@@ -94,7 +94,7 @@ jobs:
fi fi
- name: "Install Python and PDM" # https://github.com/pdm-project/setup-pdm - name: "Install: Python and PDM" # https://github.com/pdm-project/setup-pdm
uses: pdm-project/setup-pdm@v4 uses: pdm-project/setup-pdm@v4
with: with:
python-version: "${{ matrix.PYTHON_VERSION }}" python-version: "${{ matrix.PYTHON_VERSION }}"
@@ -180,10 +180,16 @@ jobs:
/tmp/upx/upx.exe --version /tmp/upx/upx.exe --version
- name: Build self-contained executable - name: Build self-contained executable
run: | run: |
set -eux set -eux
if [[ "${{ runner.os }}" == "Windows" ]]; then
NO_UPX=1 pdm run compile
mv dist/kleinanzeigen-bot.exe dist/kleinanzeigen-bot-uncompressed.exe
fi
pdm run compile pdm run compile
ls -l dist ls -l dist
@@ -234,7 +240,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- build - build
if: ${{ github.repository_owner == 'Second-Hand-Friends' && github.ref_name == 'main' && !github.event.act }} if: ${{ github.ref_name == 'main' && !github.event.act }}
concurrency: publish-latest-release # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency concurrency: publish-latest-release # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency
steps: steps:
@@ -275,6 +281,7 @@ jobs:
mv artifacts-macos-latest/kleinanzeigen-bot kleinanzeigen-bot-darwin-amd64 mv artifacts-macos-latest/kleinanzeigen-bot kleinanzeigen-bot-darwin-amd64
mv artifacts-ubuntu-latest/kleinanzeigen-bot kleinanzeigen-bot-linux-amd64 mv artifacts-ubuntu-latest/kleinanzeigen-bot kleinanzeigen-bot-linux-amd64
mv artifacts-windows-latest/kleinanzeigen-bot-uncompressed.exe kleinanzeigen-bot-windows-amd64-uncompressed.exe
mv artifacts-windows-latest/kleinanzeigen-bot.exe kleinanzeigen-bot-windows-amd64.exe mv artifacts-windows-latest/kleinanzeigen-bot.exe kleinanzeigen-bot-windows-amd64.exe
# https://cli.github.com/manual/gh_release_create # https://cli.github.com/manual/gh_release_create
@@ -285,7 +292,8 @@ jobs:
--target "${{ github.sha }}" \ --target "${{ github.sha }}" \
kleinanzeigen-bot-darwin-amd64 \ kleinanzeigen-bot-darwin-amd64 \
kleinanzeigen-bot-linux-amd64 \ kleinanzeigen-bot-linux-amd64 \
kleinanzeigen-bot-windows-amd64.exe kleinanzeigen-bot-windows-amd64.exe \
kleinanzeigen-bot-windows-amd64-uncompressed.exe
- name: "Delete intermediate build artifacts" - name: "Delete intermediate build artifacts"

View File

@@ -69,7 +69,7 @@ pyz = PYZ(
# name = None # name = None
) )
import shutil import os, shutil
# https://github.com/pyinstaller/pyinstaller/blob/f563dce1e83fd5ec72a20dffd2ac24be3e647150/PyInstaller/building/api.py#L338 # https://github.com/pyinstaller/pyinstaller/blob/f563dce1e83fd5ec72a20dffd2ac24be3e647150/PyInstaller/building/api.py#L338
exe = EXE(pyz, exe = EXE(pyz,
@@ -94,7 +94,7 @@ exe = EXE(pyz,
# contents_directory = "_internal", # contents_directory = "_internal",
# using strip on windows results in "ImportError: Can't connect to HTTPS URL because the SSL module is not available." # using strip on windows results in "ImportError: Can't connect to HTTPS URL because the SSL module is not available."
strip = not platform.startswith("win") and shutil.which("strip") is not None, strip = not platform.startswith("win") and shutil.which("strip") is not None,
upx = shutil.which("upx") is not None, upx = shutil.which("upx") is not None and not os.getenv("NO_UPX"),
upx_exclude = [], upx_exclude = [],
runtime_tmpdir = None, runtime_tmpdir = None,
) )