fix(release-gitter): correct Windows asset name for pip build#1018
Conversation
- Replaced `extract-files` with `extract-all = true` for automatic extraction - Added `AMD64 = "x86_64"` mapping for release-gitter - Removed chmod command for Windows compatibility
JohnnyMorganz
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
| extract-all = true | ||
| format = "stylua-{system}-{arch}.zip" | ||
| exec = "chmod +x stylua" | ||
| exec = """python -c " | ||
| import os | ||
| import stat | ||
| import platform | ||
|
|
||
| f = 'stylua' | ||
| s = platform.system() | ||
|
|
||
| if s in ('Linux', 'Darwin') and os.path.exists(f): | ||
| current_mode = os.stat(f).st_mode | ||
| os.chmod(f, current_mode | stat.S_IEXEC) | ||
| " """ | ||
|
|
There was a problem hiding this comment.
Why do we need all this extraction change?
I'd imagine the only thing needed would be the new entry you've added to map-arch
There was a problem hiding this comment.
The change to extract-all = true is needed because Windows executables use the .exe extension while Unix-like systems do not, but this isn’t an issue since each .zip contains only one file. Is there a way to set the extract option dynamically by OS? Also, Windows lacks a default Bash shell, so using exec = "chmod +x stylua" without a Python wrapper will cause an error in Windows.
There was a problem hiding this comment.
Makes sense, thanks for clarifying
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
==========================================
- Coverage 96.73% 96.55% -0.19%
==========================================
Files 16 16
Lines 5919 5224 -695
==========================================
- Hits 5726 5044 -682
+ Misses 193 180 -13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
And also update changelog for #1018
Currently, installing StyLua via pip fails on Windows with the following error:
This happens because the release-gitter configuration is looking for
stylua-windows-AMD64.zip, while the actual Windows asset is published under a different name (e.g.,stylua-win64.ziporstylua-windows-x86_64.zip).This PR updates the release-gitter configuration to match the correct Windows asset name, allowing StyLua to be successfully built and installed via pip on Windows.
✅ Fixes pip installation failure on Windows
✅ Ensures release-gitter resolves the proper asset