Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
michaeltlombardi opened this issue Oct 5, 2022 · 3 comments · May be fixed by #609
Open
3 tasks done

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

michaeltlombardi opened this issue Oct 5, 2022 · 3 comments · May be fixed by #609
Assignees
Labels
support User support

Comments

@michaeltlombardi
Copy link

michaeltlombardi commented Oct 5, 2022

Checklist

  • I am using the latest version of this action.
  • I have read the latest README and followed the instructions.
  • 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.

@peaceiris
Copy link
Owner

peaceiris commented Oct 5, 2022

Thanks.

related to #605

@michaeltlombardi
Copy link
Author

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 added a commit to michaeltlombardi/actions-hugo that referenced this issue Oct 6, 2022
Prior to this change, the URL building for versions of hugo was
deterministic as the URLs for the packages were set to a
project-specific standard. That URL creation began to fail for macOS in
[0.102.0] and for Windows in [0.103.0]. It does not fail for Linux
because the hugo releases for Linux continue to include the old package
naming as an alias.

This change:

- Updates the `get-os` function to take the hugo version as additional
  input, altering the return value based on the version.
- Updates the `get-arch` function to take the operating system name and
  hugo version as additional input, altering the return value based on
  both. Including the OS name is required for handling macOS.
- Fixes peaceiris#608
- Fixes peaceiris#605
michaeltlombardi added a commit to michaeltlombardi/actions-hugo that referenced this issue Oct 6, 2022
Prior to this change, the URL building for versions of hugo was
deterministic as the URLs for the packages were set to a
project-specific standard. That URL creation began to fail for macOS in
[0.102.0] and for Windows in [0.103.0]. It does not fail for Linux
because the hugo releases for Linux continue to include the old package
naming as an alias.

This change:

- Updates the `get-os` function to take the hugo version as additional
  input, altering the return value based on the version.
- Updates the `get-arch` function to take the operating system name and
  hugo version as additional input, altering the return value based on
  both. Including the OS name is required for handling macOS.
- Fixes peaceiris#608
- Fixes peaceiris#605

[0.102.0]: https://github.com/gohugoio/hugo/releases/tag/v0.102.0
[0.103.0]: https://github.com/gohugoio/hugo/releases/tag/v0.103.0
michaeltlombardi added a commit to michaeltlombardi/actions-hugo that referenced this issue Oct 14, 2022
This commit introduces the getConventions function, which does a one-time calculation
for the changes in packaging conventions to propagate to the getArch and getOS
functions.

It updates those functions and the installer code to leverage the conventions.

Finally, it updates the test arrangement for getArch and getOS to use test cases
instead of repeating the same test over and over and adds unit tests for the new
getConventions function.
drmowinckels added a commit to drmowinckels/drmowinckels.github.io that referenced this issue Dec 2, 2022
drmowinckels added a commit to drmowinckels/drmowinckels.github.io that referenced this issue Dec 2, 2022
* update hugo and npm

* update hugo

* revert hugo becasue of peaceiris/actions-hugo#608
jaaufauvre added a commit to manixate/jest-hugo that referenced this issue Dec 19, 2022
drmowinckels added a commit to drmowinckels/drmowinckels.github.io that referenced this issue Oct 19, 2023
* update hugo and npm

* update hugo

* revert hugo becasue of peaceiris/actions-hugo#608

* update about
@rdegges
Copy link

rdegges commented Jul 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support User support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants