Skip to content

Commit 130b920

Browse files
authored
fix(ci): fix PyInstaller build and run PR builds (#331)
1 parent ed2f63f commit 130b920

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

.github/workflows/release-cli.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
paths:
77
- "cli/**"
88
- ".github/workflows/release-cli.yml"
9+
pull_request:
10+
paths:
11+
- "cli/**"
12+
- ".github/workflows/release-cli.yml"
913
workflow_dispatch:
1014

1115
jobs:
@@ -37,6 +41,13 @@ jobs:
3741
with:
3842
platforms: arm64
3943

44+
- name: Login to GHCR
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
4051
- name: Install Poetry
4152
uses: snok/install-poetry@v1
4253
with:
@@ -70,6 +81,8 @@ jobs:
7081
7182
- name: Build CLI binary
7283
working-directory: cli
84+
env:
85+
NIXOPUS_DISABLE_DOCKER: ${{ github.event_name == 'pull_request' && '1' || '' }}
7386
run: |
7487
chmod +x build.sh
7588
if [ ! -d "helpers" ]; then

cli/build.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,19 @@ run_pyinstaller_build() {
164164
;;
165165
esac
166166

167-
if [[ -n "$MANYLINUX_IMAGE" ]]; then
168-
log_info "Building with PyInstaller inside $MANYLINUX_IMAGE for wide glibc compatibility..."
169-
docker run --rm -v "$(cd .. && pwd)":/work -w /work/cli "$MANYLINUX_IMAGE" bash -lc \
170-
"export PATH=/opt/python/$PYTAG/bin:\$PATH && \
171-
python3 -m pip install -U pip && \
167+
# Use official PyInstaller image to ensure presence of libpython shared library
168+
PYI_IMAGE="ghcr.io/pyinstaller/pyinstaller:py3.11"
169+
log_info "Building with PyInstaller inside $PYI_IMAGE for reliable shared-lib Python..."
170+
docker run --rm -v "$(cd .. && pwd)":/work -w /work/cli "$PYI_IMAGE" bash -lc \
171+
"python3 -m pip install -U pip && \
172172
python3 -m pip install 'poetry==1.8.3' && \
173+
poetry config virtualenvs.in-project true && \
173174
poetry install --with dev && \
174175
poetry run pyinstaller --clean --noconfirm $SPEC_FILE" || {
175-
log_error "Dockerized build failed"
176-
exit 1
177-
}
178-
return
179-
fi
176+
log_error "Dockerized build failed"
177+
exit 1
178+
}
179+
return
180180

181181
log_warning "Unsupported arch $ARCH for manylinux; building on host (may require newer glibc)"
182182
fi
@@ -361,4 +361,4 @@ main() {
361361
fi
362362
}
363363

364-
main "$@"
364+
main "$@"

0 commit comments

Comments
 (0)