pbrisbin / setup-tool-action

Generic action for installation of any tool that offers pre-compiled binaries for download
MIT License
4 stars 2 forks source link

Provide location as output #76

Closed Vampire closed 1 month ago

Vampire commented 2 months ago

I use (or try to) your action to download an exe file on a Linux or macOS runner that I then feed to wine for installation.

Can you please provide the path to the downloaded file and / or extracted directory as output of the action?

Just having it in the PATH is not sufficient for this use-case.

pbrisbin commented 2 months ago

I've added the directory output in #79. I don't think I can add an output for the executable(s), since we don't know what they'll extract. Hopefully directory is enough. You can test this now by using pbrisbin/setup-action-tool@pb/next, but I should be releasing the next version soon.

Vampire commented 2 months ago

In my case I directly download the executable, so in my case I would indeed need the path to the concrete downloaded file. Right now I have

name: 'innosetup.exe'
version: '6.3.3'
url: 'https://files.jrsoftware.org/is/6/innosetup-{version}.exe'
no-extract: 'true'

and then

command: 'wine ${{ runner.tool_cache }}/innosetup.exe/6.3.3/x64/innosetup.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART'

With directory output it would then be

command: 'wine ${{ steps.provision-innosetup.outputs.directory }}/innosetup.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART'

which is ok, thanks, with file output it would be

command: 'wine ${{ steps.provision-innosetup.outputs.file }} /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
pbrisbin commented 2 months ago

Right, but you understand why I can't supply file right? The action has no idea what executables will come out of the archive it's extracting. The best we can do is the directory form.

Vampire commented 2 months ago

I do not understand actually, because again, there is no extracting happening in my case. :-)

Vampire commented 2 months ago

But as I said, I'm fine with directory if it works for my use-case, right now testing.

pbrisbin commented 2 months ago

Hmm,

url: 'https://files.jrsoftware.org/is/6/innosetup-{version}.exe'
command: 'wine ${{ steps.provision-innosetup.outputs.directory }}/innosetup.exe ...'

How does innosetup-{version}.exe become .../innosetup.exe between these two examples?

pbrisbin commented 2 months ago

Ah, because it's downloaded to name. I see. So, if-and-only-if one uses no-extract: true then outputs.directory/inputs.name is what I could spit back as file. I'm not sure it's worth it. :thinking:

Vampire commented 2 months ago

Your decision, I just tried with pb/next and it works fine for me with directory, thanks.

pbrisbin commented 1 month ago

OK, I think simply echoing back outputs.file = outputs.directory/inputs.name would be valuable. If nothing else, we can at least take care of the cross-platform fs.join needed. So I do plan to add it, but I decided to merge that other PR first since it fixes a bunch of things.