actions-hugo icon indicating copy to clipboard operation
actions-hugo copied to clipboard

support: Action failing on v0.103.0+ due to archive name standardization

Open michaeltlombardi opened this issue 2 years ago • 3 comments

Checklist

  • [X] I am using the latest version of this action.
  • [X] I have read the latest README and followed the instructions.
  • [X] I have read the latest GitHub Actions official documentation and learned the basic spec and concepts.

Describe your question

Up until hugo v0.102.3, the action was able to discover and install the latest version. Starting with v0.103.0, x64 installs fail due to package renaming.

The release notes state:

We have standardised the archive names for the release archives (as you can see further below). Hugo has since the first version used a rather odd and non-standard mixed case naming of the archive files (e.g. hugo_0.102.3_OpenBSD-64bit.tar.gz). We now use the standard GOOS/GOARCH values as-is, which makes it easier for people to script against. To avoid breakage when running on Netlify and similar, we create aliases for the most commonly downloaded Linux-archives on the old format and will continue to do so in the foreseeable future.

In v0.103.0 the only versions aliased to 64bit from the new amd64 are hugo_<version>_Linux and hugo_extended_<version>_Linux.

The canonical new naming convention (for platforms/formats supported by this action) is:

  • hugo_<version>_darwin-universal.tar.gz
  • hugo_<version>_linux-amd64.tar.gz
  • hugo_<version>_windows-amd64.zip
  • hugo_extended_<version>_darwin-universal.tar.gz
  • hugo_extended_<version>_linux-amd64.tar.gz
  • hugo_extended_<version>_windows-amd64.zip

These have been stable since v0.103.0 and are used in the most recent release, v0.104.3.

For backwards compatibility, I suggest:

  1. The URL builder take into account the version of the binary when determining the os and arch segments of the download url. Due to the changes to macOS, arch also needs to take the os into account.
  2. For macOS:
    • The os should be darwin for 0.103.0+, and otherwise macOS.
    • The arch should be universal for 0.102.0+, and otherwise the old values.
  3. For Linux:
    • The os should be linux for 0.103.0+, and otherwise Linux.
    • the arch should be amd64 or arm64 for 0.103.0+, and otherwise the old values.
  4. For Windows:
    • The os should be windows for 0.103.0+, and otherwise Windows.
    • the arch should be amd64 or arm64 for 0.103.0+, and otherwise the old values.

Relevant links

Failing workflow run: https://github.com/platenio/platen-template/actions/runs/3186514784/jobs/5204230214#step:3:37

Relevant log output

Hugo version: 0.104.3
##[debug]Hugo extended: true
##[debug]Operating System: Windows
##[debug]Processor Architecture: 64bit
##[debug]toolURL: https://github.com/gohugoio/hugo/releases/download/v0.104.3/hugo_extended_0.104.3_Windows-64bit.zip
##[debug]homeDir: C:\Users\runneradmin
##[debug]workDir: C:\Users\runneradmin\actions_hugo
##[debug]binDir: C:\Users\runneradmin\actions_hugo\bin
##[debug]tempDir: C:\Users\runneradmin\actions_hugo\_temp
##[debug]Downloading https://github.com/gohugoio/hugo/releases/download/v0.104.3/hugo_extended_0.104.3_Windows-64bit.zip
##[debug]Destination D:\a\_temp\c7e23ba8-7a61-4d0f-b868-[41](https://github.com/platenio/platen-template/actions/runs/3186514784/jobs/5204230214#step:3:43)f3a71ac689
##[debug]Failed to download from "https://github.com/gohugoio/hugo/releases/download/v0.104.3/hugo_extended_0.104.3_Windows-64bit.zip". Code(404) Message(Not Found)
Error: Action failed with error Unexpected HTTP response: 404

Additional context.

I'm happy to put up a (naive) PR for this, though I don't think I've got the time/skill to add appropriate testing in a quick or elegant fashion.

michaeltlombardi avatar Oct 05 '22 13:10 michaeltlombardi

Thanks.

related to https://github.com/peaceiris/actions-hugo/issues/605

peaceiris avatar Oct 05 '22 14:10 peaceiris

I think it's a related issue, but not a duplicate - they first changed the naming for the macOS package from macOS to darwin, but in 0.103.0 they changed the naming for the architecture all-up, which impacts Windows (how I found the problem) and Linux (though they kept backwards compatibility that I think keeps this action working for runs on Ubuntu).

michaeltlombardi avatar Oct 05 '22 20:10 michaeltlombardi

Sorry to chime in annoyingly, but any chance this could get an update? I've also ran into this issue which makes using the action difficult. Appreciate all of your time/debugging here. <3

rdegges avatar Jul 21 '24 17:07 rdegges