77 build :
88 strategy :
99 matrix :
10- os : [ubuntu-latest, windows-latest]
10+ include :
11+ - os : ubuntu-latest
12+ platform : linux-x64
13+ wheel_platform : manylinux_2_17_x86_64
14+ - os : ubuntu-24.04-arm
15+ platform : linux-arm64
16+ wheel_platform : manylinux_2_17_aarch64
17+ - os : windows-latest
18+ platform : win32-x64
19+ wheel_platform : win_amd64
20+ - os : macos-13
21+ platform : darwin-x64
22+ wheel_platform : macosx_10_9_x86_64
23+ - os : macos-latest
24+ platform : darwin-arm64
25+ wheel_platform : macosx_11_0_arm64
1126
1227 runs-on : ${{ matrix.os }}
1328
@@ -25,14 +40,83 @@ jobs:
2540 - run : npm ci
2641 - run : npm run build-webview
2742 - run : npm run build-cli
28- - run : npm run package
43+ - name : Package VSCode Extension for Windows
44+ if : matrix.platform == 'win32-x64'
45+ run : npm run package:win
46+ - name : Package VSCode Extension for ${{ matrix.platform }}
47+ if : matrix.platform != 'win32-x64'
48+ run : npm run package -- --target ${{ matrix.platform }}
2949 - run : python -m pip install -e .[dev]
30- - run : hatch build
31- - uses : actions/upload-artifact@v4
50+ - run : hatch build -t wheel
51+
52+ # Upload VSIX files individually (not as zip)
53+ - name : Find VSIX file
54+ id : find-vsix
55+ shell : bash
56+ run : |
57+ VSIX_FILE=$(find . -name "*.vsix" -type f | head -1)
58+ if [ -z "$VSIX_FILE" ]; then
59+ echo "No VSIX file found!"
60+ exit 1
61+ fi
62+ echo "vsix-file=$VSIX_FILE" >> $GITHUB_OUTPUT
63+ # Extract base name and create platform-specific name
64+ BASE_NAME=$(basename "$VSIX_FILE" .vsix)
65+ PLATFORM_VSIX="${BASE_NAME}.vsix"
66+ echo "platform-vsix-name=$PLATFORM_VSIX" >> $GITHUB_OUTPUT
67+
68+ - name : Upload VSIX for ${{ matrix.platform }}
69+ uses : actions/upload-artifact@v4
3270 with :
33- name : poml-vscode-${{ matrix.os }}
34- path : " *.vsix"
35- - uses : actions/upload-artifact@v4
71+ name : ${{ steps.find-vsix.outputs.platform-vsix-name }}
72+ path : ${{ steps.find-vsix.outputs.vsix-file }}
73+ compression-level : 0
74+
75+ # Upload Python wheel files individually
76+ - name : Find and upload Python wheel
77+ shell : bash
78+ run : |
79+ WHEEL_FILE=$(find dist -name "*.whl" -type f | head -1)
80+ if [ -z "$WHEEL_FILE" ]; then
81+ echo "No wheel file found!"
82+ exit 1
83+ fi
84+ echo "wheel-file=$WHEEL_FILE" >> $GITHUB_OUTPUT
85+
86+ # Parse the original wheel filename to extract components
87+ WHEEL_NAME=$(basename "$WHEEL_FILE" .whl)
88+
89+ # Split wheel name into components: name-version-python_tag-abi_tag-platform_tag
90+ # Example: poml-0.0.5-py3-none-any -> poml, 0.0.5, py3, none, any
91+ IFS='-' read -ra PARTS <<< "$WHEEL_NAME"
92+
93+ if [ ${#PARTS[@]} -ge 5 ]; then
94+ # Standard format: name-version-python_tag-abi_tag-platform_tag
95+ DIST_NAME="${PARTS[0]}"
96+ VERSION="${PARTS[1]}"
97+ PYTHON_TAG="${PARTS[2]}"
98+ ABI_TAG="${PARTS[3]}"
99+ # Join remaining parts as platform tag (in case there are extra hyphens)
100+ PLATFORM_TAG=$(IFS='-'; echo "${PARTS[*]:4}")
101+ else
102+ echo "Warning: Unexpected wheel filename format: $WHEEL_NAME"
103+ # Fallback to original naming
104+ echo "platform-wheel-name=$WHEEL_NAME-${{ matrix.platform }}.whl" >> $GITHUB_OUTPUT
105+ exit 0
106+ fi
107+
108+ # Create platform-specific wheel name with proper platform tag
109+ PLATFORM_WHEEL="${DIST_NAME}-${VERSION}-${PYTHON_TAG}-${ABI_TAG}-${{ matrix.wheel_platform }}.whl"
110+ echo "platform-wheel-name=$PLATFORM_WHEEL" >> $GITHUB_OUTPUT
111+
112+ # Rename the wheel file to platform-specific name
113+ cp "$WHEEL_FILE" "dist/$PLATFORM_WHEEL"
114+ echo "renamed-wheel-file=dist/$PLATFORM_WHEEL" >> $GITHUB_OUTPUT
115+ id : find-wheel
116+
117+ - name : Upload Python wheel for ${{ matrix.platform }}
118+ uses : actions/upload-artifact@v4
36119 with :
37- name : poml-python-${{ matrix.os }}
38- path : dist/*
120+ name : ${{ steps.find-wheel.outputs.platform-wheel-name }}
121+ path : ${{ steps.find-wheel.outputs.renamed-wheel-file }}
122+ compression-level : 0
0 commit comments