Closed idanarye closed 2 years ago
I just ran into this as well while attempting to build mac app images. This should also work fine there. (but it's not causing any issues with the current mac setup)
vimtor/action-zip
is a node app that uses a pure js library for zipping things and it seems to have limited support for file attributes. So I feel like it's probably not be a bad idea to ditch it all-together. (I'm open to understanding why this is not insane)
We could perhaps use montudor/action-zip
across the board if we want symmetry in the zip step on windows as well. But I think that zip -r
is pretty universal...
Yeah, can we get away with swapping this for all our OS's? It definitely feels silly to be pulling in an Action for this.
MacOS is already zipping with a shell command, and WASM is build on Linux so I can just copy-paste the code that zips the Linux build. That just leaves us with Windows, which is going to be as fun as running CLI scripts in Windows can be.
MacOS is already zipping with a shell command
Ah right, I am currently experimenting with macos and forgot that I had copied the zip step from the other OSs.
I have a feeling that the windows situation will be very easy, but at the very least we should use the other github action which is a wrapper around Info-Zip
instead of some janky javascript.
montudor/action-zip is Linux only...
Actually, doing for Windows is going to be easy - I forgot I can use shell: powershell
.
Oops, did not realize that GH doesn't do docker on Windows. That explains the javascript.
I don't personally think we need to block on this, but windows seems doable without shell: powershell
with something like
- name: Package as a zip
run: |
Compress-Archive -Path windows/* -DestinationPath ${{ env.binary }}.zip
Pretty sure Compress-Archive
is a powershell cmdlet - so maybe that just means powershell is the default shell for Windows?
The default seems to be pwsh
which is "Powershell Core" but whatever it is, Compress-Archive
seems to work.
Tested over here: https://github.com/rparrett/bevy_github_ci_template/commit/0fc5b7f9e79bb628f0b961fe8d502a663aae31fa https://github.com/rparrett/bevy_github_ci_template/releases
Archive: bevy_github_ci_template-windows-v0.1.0-pre.zip
Zip file size: 6783748 bytes, number of entries: 2
-rw---- 2.0 fat 15713 b- defN 22-Sep-07 15:48 assets/icon.png
-rwx--- 2.0 fat 20421632 b- defN 22-Sep-07 16:02 bevy_github_ci_template.exe
2 files, 20437345 bytes uncompressed, 6783490 bytes compressed: 66.8%
OK. @rparrett - I've copy-pasted your code, and also changed the WASM build to use the CLI. Testing it now with https://github.com/idanarye/bevy_github_ci_template/actions/runs/3010605732
Seems to be working fine
vimtor/action-zip
seems to have a problem where it does not encode the binary's execute permission in the archive.