Skip to content

Commit 882fb9f

Browse files
committed
fix: windows build path issue in workflow
1 parent 44f19f6 commit 882fb9f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/build-release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,21 @@ jobs:
4545
4646
if [[ "${{ runner.os }}" == "Windows" ]]; then
4747
cp dist/strix.exe "dist/release/strix-${VERSION}-${{ matrix.target }}.exe"
48-
cd dist/release && 7z a "strix-${VERSION}-${{ matrix.target }}.zip" "strix-${VERSION}-${{ matrix.target }}.exe"
48+
# Use 7z relative path, avoid cd
49+
7z a "dist/release/strix-${VERSION}-${{ matrix.target }}.zip" "./dist/release/strix-${VERSION}-${{ matrix.target }}.exe"
4950
else
5051
cp dist/strix "dist/release/strix-${VERSION}-${{ matrix.target }}"
5152
chmod +x "dist/release/strix-${VERSION}-${{ matrix.target }}"
52-
cd dist/release && tar -czvf "strix-${VERSION}-${{ matrix.target }}.tar.gz" "strix-${VERSION}-${{ matrix.target }}"
53+
# Use tar with -C to change directory safely during archive creation
54+
tar -C dist/release -czvf "dist/release/strix-${VERSION}-${{ matrix.target }}.tar.gz" "strix-${VERSION}-${{ matrix.target }}"
5355
fi
5456
5557
# Test
56-
cd ${{ github.workspace }}/dist/release
58+
echo "Testing binary..."
5759
if [[ "${{ runner.os }}" == "Windows" ]]; then
58-
"./strix-${VERSION}-${{ matrix.target }}.exe" --help
60+
"./dist/release/strix-${VERSION}-${{ matrix.target }}.exe" --help
5961
else
60-
"./strix-${VERSION}-${{ matrix.target }}" --help
62+
"./dist/release/strix-${VERSION}-${{ matrix.target }}" --help
6163
fi
6264
6365
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)