Verify published binaries run before archiving in CI#398
Conversation
Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
| - name: Publish | ||
| run: dotnet publish src/Stack/Stack.csproj -c Release -r ${{ matrix.runtime-id }} -p:Version=${{ needs.version.outputs.version }} -p:DebugType=None -p:DebugSymbols=false -o ${{ github.workspace }}/publish | ||
|
|
||
| - name: Test binary (Windows) |
There was a problem hiding this comment.
@copilot Instead of detecting the os and running separate steps for Linux vs Windows, add the exe name to the matrix values above and use that with a single verification step.
There was a problem hiding this comment.
Done. Added executable property to the matrix (stack/stack.exe) and replaced the two conditional steps with a single step that uses ${{ matrix.executable }}. The chmod +x command includes || true so it won't fail on Windows. (bd2ab0d)
Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
| runtime-id: win-arm64 | ||
| artifact-name: windows_arm64 | ||
| archive_type: zip | ||
| os: windows-latest |
There was a problem hiding this comment.
@copilot the windows arm64 ci build is failing because it's running on windows-latest which is x64. Is there another runner image that can be used for this?
There was a problem hiding this comment.
Changed to windows-11-arm which is the GitHub Actions runner image for Windows ARM64. This will run the build on native ARM64 hardware instead of x64. (33403a8)
Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
Add binary verification step to CI workflow
Understanding the issue:
dotnet publish, binaries should be tested to ensure they run--versionoptionPlan
--versionoption existsChanges Made
executableproperty to each matrix entry (stackfor Linux/macOS,stack.exefor Windows)chmod +xwith|| trueto make binary executable (no-op on Windows)${{ matrix.executable }} --versionusing the matrix propertywindows-latesttowindows-11-armto fix x64/ARM64 architecture mismatchThis approach is cleaner and more maintainable than OS-specific conditional steps.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.