cross-platform-actions / action

Cross-platform GitHub action
MIT License
140 stars 19 forks source link

The FreeBSD 13.0 bulid does not work #6

Closed gansm closed 2 years ago

gansm commented 2 years ago
Downloading disk image: https://github.com/cross-platform-actions/freebsd-builder/releases/download/v0.2.0/freebsd-13-x86-64.qcow2
Downloading hypervisor: https://github.com/cross-platform-actions/resources/releases/download/v0.3.1/xhyve-macos.tar
Downloading resources: https://github.com/cross-platform-actions/resources/releases/download/v0.3.1/resources-macos.tar
/usr/sbin/mkfile -n 40m /tmp/resourcesNeMLJA/res.raw
/usr/bin/ssh-keygen -t ed25519 -f /tmp/resourcesNeMLJA/id_ed25519 -q -N 
Error: Unexpected HTTP response: 404

The problem is the name of the downloaded disk image: freebsd-13-x86-64.qcow2 vs. freebsd-13.0-x86-64.qcow2

https://github.com/gansm/finalcut/runs/4493630197?check_suite_focus=true

Maybe this can solve your problem:

var version = 13.0;
encodeURIComponent(version.toFixed(1));
jacob-carlborg commented 2 years ago

The problem is that the OS version needs to be specified as a string in the YAML file, otherwise YAML will treat 13.0 as a floating point number and remove the decimal part. This only occurs when the decimal part is 0, because 13.0 and 13 are the same. This is not a problem with 12.2 for example, since 12.2 and 12 are not the same and .2 is preserved. This is one of the quirks with YAML. The solution is to specify the OS as a string by surrounding the value in quotes: https://github.com/cross-platform-actions/action/blob/193dcd15b0747f21a2ef9f5fc6cbd125e62c1745/.github/workflows/ci.yml#L35

gansm commented 2 years ago

But wouldn't it be better to solve this in the backend? So it would no longer be a problem for the user.

> version = 13.0;
13
> version
13
> version.toFixed(1);
'13.0'
jacob-carlborg commented 2 years ago

I don't want the action to impose any restrictions on what the OS version can be. What if the version for some OS contains letters? Or for some OS it should 10 and not 10.0, for example.

I prefer to keep it as is. I can improve the documentation and include the data type for each parameter. I can also mention this quirk.

gansm commented 2 years ago

Alright, but you should improve your documentation to prevent more users from falling into this trap.

jacob-carlborg commented 2 years ago

I've updated the documentation: https://github.com/cross-platform-actions/action/commit/61acfa10c87b5766f42c4f4f353bd0bbf2c9893f. I've also update the examples and CI workflows file to always use quotes.