bevyengine / bevy_github_ci_template

Apache License 2.0
202 stars 45 forks source link

Zip with CLI in `release-linux` #11

Closed idanarye closed 2 years ago

idanarye commented 2 years ago

vimtor/action-zip seems to have a problem where it does not encode the binary's execute permission in the archive.

rparrett commented 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...

alice-i-cecile commented 2 years ago

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.

idanarye commented 2 years ago

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.

rparrett commented 2 years ago

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.

idanarye commented 2 years ago

montudor/action-zip is Linux only...

Actually, doing for Windows is going to be easy - I forgot I can use shell: powershell.

rparrett commented 2 years ago

Oops, did not realize that GH doesn't do docker on Windows. That explains the javascript.

rparrett commented 2 years ago

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
idanarye commented 2 years ago

Pretty sure Compress-Archive is a powershell cmdlet - so maybe that just means powershell is the default shell for Windows?

rparrett commented 2 years ago

The default seems to be pwsh which is "Powershell Core" but whatever it is, Compress-Archive seems to work.

idanarye commented 2 years ago

https://docs.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.2#renamed-powershellexe-to-pwshexe

Seem like pwsh is the newer version?

rparrett commented 2 years ago

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%
idanarye commented 2 years ago

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

idanarye commented 2 years ago

Seems to be working fine