Workflow: Fix shell variable expansion for Windows container naming
This commit is contained in:
@@ -37,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Windows executable (Self-Built Environment)
|
- name: Build Windows executable (Self-Built Environment)
|
||||||
run: |
|
run: |
|
||||||
# 1. Create a local Dockerfile for a guaranteed working environment
|
# 1. Create a local Dockerfile
|
||||||
cat <<EOF > Dockerfile.win
|
cat <<EOF > Dockerfile.win
|
||||||
FROM python:3.10-slim
|
FROM python:3.10-slim
|
||||||
RUN apt-get update && apt-get install -y wine binutils-mingw-w64-x86-64 && apt-get clean
|
RUN apt-get update && apt-get install -y wine binutils-mingw-w64-x86-64 && apt-get clean
|
||||||
@@ -45,19 +45,20 @@ jobs:
|
|||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# 2. Build the local image
|
# 2. Build local image
|
||||||
docker build -t local-win-builder -f Dockerfile.win .
|
docker build -t local-win-builder -f Dockerfile.win .
|
||||||
|
|
||||||
# 3. Create container and copy files
|
# 3. Use unique container name (Fixed shell variable expansion)
|
||||||
CONTAINER_NAME="win-build-${{ github.run_id }}"
|
CONTAINER_NAME="win-build-${{ github.run_id }}"
|
||||||
docker create --name \$CONTAINER_NAME local-win-builder sh -c "pyinstaller --onefile --name tamigo-cli tamigo.py"
|
|
||||||
docker cp . \$CONTAINER_NAME:/src
|
docker create --name $CONTAINER_NAME local-win-builder sh -c "pyinstaller --onefile --name tamigo-cli tamigo.py"
|
||||||
|
docker cp . $CONTAINER_NAME:/src
|
||||||
|
|
||||||
# 4. Start build and extract
|
# 4. Start build and extract
|
||||||
docker start -a \$CONTAINER_NAME
|
docker start -a $CONTAINER_NAME
|
||||||
mkdir -p win_dist
|
mkdir -p win_dist
|
||||||
docker cp \$CONTAINER_NAME:/src/dist/. ./win_dist/
|
docker cp $CONTAINER_NAME:/src/dist/. ./win_dist/
|
||||||
docker rm \$CONTAINER_NAME
|
docker rm $CONTAINER_NAME
|
||||||
|
|
||||||
- name: Debug - List Files
|
- name: Debug - List Files
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user