Skip to content

Commit af1b193

Browse files
authored
Merge pull request #31 from AI4quantum/windoze-release-ci
bug: fix release CI issue with Windows exec
2 parents fdeade5 + 6c52881 commit af1b193

File tree

1 file changed

+56
-41
lines changed

1 file changed

+56
-41
lines changed

.github/workflows/cli_release.yml

Lines changed: 56 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,66 @@ jobs:
2323
go-version: ${{ matrix.go-version }}
2424
cache: true
2525

26-
- name: Build CLI
26+
- name: Build CLI (Windows)
27+
if: matrix.os == 'windows-latest'
2728
working-directory: ./cli
2829
run: |
2930
echo "Building maestro-k CLI for ${{ matrix.os }}..."
3031
go mod download
3132
32-
# Set output name based on OS
33-
if [ "${{ matrix.os }}" = "windows-latest" ]; then
34-
OUTPUT_NAME="maestro-k.exe"
35-
else
36-
OUTPUT_NAME="maestro-k"
37-
fi
33+
$VERSION = "${{ github.ref_name }}"
34+
$BUILD_TIME = (Get-Date -Format "yyyy-MM-dd_HH:mm:ss_UTC").ToString()
35+
36+
go build -ldflags="-s -w -X main.version=$VERSION -X main.buildTime=$BUILD_TIME" -o "maestro-k.exe" ./src
37+
echo "Build successful: maestro-k.exe"
38+
39+
- name: Build CLI (Unix)
40+
if: matrix.os != 'windows-latest'
41+
working-directory: ./cli
42+
run: |
43+
echo "Building maestro-k CLI for ${{ matrix.os }}..."
44+
go mod download
3845
39-
# Build with version info
4046
VERSION=${{ github.ref_name }}
4147
BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S_UTC')
4248
43-
go build -ldflags="-s -w -X main.version=$VERSION -X main.buildTime=$BUILD_TIME" \
44-
-o "$OUTPUT_NAME" ./src
49+
go build -ldflags="-s -w -X main.version=$VERSION -X main.buildTime=$BUILD_TIME" -o "maestro-k" ./src
50+
chmod +x maestro-k
51+
echo "Build successful: maestro-k"
4552
46-
chmod +x "$OUTPUT_NAME"
47-
echo "Build successful: $OUTPUT_NAME"
48-
49-
- name: Test CLI
53+
- name: Test CLI (Unix)
54+
if: matrix.os != 'windows-latest'
5055
working-directory: ./
5156
run: |
5257
echo "Running CLI tests..."
5358
./test.sh cli
5459
echo "All tests passed!"
5560
56-
- name: Test CLI functionality
61+
- name: Test CLI (Windows)
62+
if: matrix.os == 'windows-latest'
63+
working-directory: ./
64+
run: |
65+
echo "Skipping CLI tests on Windows (test.sh requires bash)"
66+
echo "Windows build completed successfully"
67+
68+
- name: Test CLI functionality (Windows)
69+
if: matrix.os == 'windows-latest'
70+
run: |
71+
echo "Testing CLI functionality..."
72+
Copy-Item "cli/maestro-k.exe" "./maestro-k.exe"
73+
./maestro-k.exe --version
74+
./maestro-k.exe --help
75+
./maestro-k.exe validate --help
76+
77+
- name: Test CLI functionality (Unix)
78+
if: matrix.os != 'windows-latest'
5779
run: |
5880
echo "Testing CLI functionality..."
59-
# Copy binary to root for testing
60-
if [ "${{ matrix.os }}" = "windows-latest" ]; then
61-
cp cli/maestro-k.exe ./maestro-k.exe
62-
chmod +x ./maestro-k.exe
63-
./maestro-k.exe --version
64-
./maestro-k.exe --help
65-
./maestro-k.exe validate --help
66-
else
67-
cp cli/maestro-k ./maestro-k
68-
chmod +x ./maestro-k
69-
./maestro-k --version
70-
./maestro-k --help
71-
./maestro-k validate --help
72-
fi
81+
cp cli/maestro-k ./maestro-k
82+
chmod +x ./maestro-k
83+
./maestro-k --version
84+
./maestro-k --help
85+
./maestro-k validate --help
7386
7487
- name: Upload CLI artifact
7588
uses: actions/upload-artifact@v4
@@ -80,17 +93,19 @@ jobs:
8093
maestro-k.exe
8194
retention-days: 30
8295

83-
- name: Show CLI info
96+
- name: Show CLI info (Windows)
97+
if: matrix.os == 'windows-latest'
98+
run: |
99+
echo "CLI binary information:"
100+
Get-ChildItem -Path "maestro-k.exe" | Select-Object Name, Length, LastWriteTime
101+
echo "CLI version:"
102+
./maestro-k.exe --version
103+
104+
- name: Show CLI info (Unix)
105+
if: matrix.os != 'windows-latest'
84106
run: |
85107
echo "CLI binary information:"
86-
if [ "${{ matrix.os }}" = "windows-latest" ]; then
87-
ls -lh maestro-k.exe
88-
file maestro-k.exe
89-
echo "CLI version:"
90-
./maestro-k.exe --version
91-
else
92-
ls -lh maestro-k
93-
file maestro-k
94-
echo "CLI version:"
95-
./maestro-k --version
96-
fi
108+
ls -lh maestro-k
109+
file maestro-k
110+
echo "CLI version:"
111+
./maestro-k --version

0 commit comments

Comments
 (0)