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

incorrect release URL for macOS (darwin) runners #332

Open
3 tasks done
na4ma4 opened this issue Jun 24, 2024 · 5 comments
Open
3 tasks done

incorrect release URL for macOS (darwin) runners #332

na4ma4 opened this issue Jun 24, 2024 · 5 comments

Comments

@na4ma4
Copy link

na4ma4 commented Jun 24, 2024

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

When using the action on a macOS runner it will fail to download the release binary.

Expected behaviour

For the action to download the correct binary.

Actual behaviour

Run magefile/mage-action@v3
Mage version found: v1.1[5](https://github.com/na4ma4/mage-macos-issue/actions/runs/9638247781/job/26578654439#step:4:6).0
Downloading https://github.com/magefile/mage/releases/download/v1.15.0/mage_1.15.0_macOS-ARM[6](https://github.com/na4ma4/mage-macos-issue/actions/runs/9638247781/job/26578654439#step:4:7)4.tar.gz...
Error: Unexpected HTTP response: 404

Steps to reproduce

  1. Use magefile/mage-action in workflow.
  2. runs-on: macos-latest
  3. step will fail

Repository URL

https://github.com/na4ma4/mage-macos-issue

Workflow run URL

https://github.com/na4ma4/mage-macos-issue/actions/runs/9638284485

YAML workflow

name: "GoReleaser"

on:
  push:
  workflow_dispatch:


jobs:
  mage-test:
    name: "Mage Test: ${{ matrix.os }}"
    strategy:
      fail-fast: false
      matrix:
        os: ['macos-latest', 'ubuntu-latest']
    runs-on: ${{ matrix.os }}
    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Set up Go
      uses: actions/setup-go@v4
      with:
        cache: false
        go-version: ^1
      id: go

    - name: Run Mage
      uses: magefile/mage-action@v3

Workflow logs

logs_25224800589.zip

Additional info

No response

@crazy-max
Copy link
Member

Is it still happening? I'm not able to repro with all macOS runners available: https://github.com/magefile/mage-action/actions/runs/11550066329?pr=341

@na4ma4
Copy link
Author

na4ma4 commented Oct 29, 2024

Interesting that your runs seem to pull the mage binary from the actions cache but when I test it, it's downloading it from the repo artifacts.

It still happens for me, I wonder how it got downloaded into the cache the first time for your runs.

@na4ma4
Copy link
Author

na4ma4 commented Oct 29, 2024

I'm looking through previous runs in this repository, but here's the relevant line

@na4ma4
Copy link
Author

na4ma4 commented Oct 29, 2024

Ok, so if I make a runner for macos-13 (which is x64) and run it first, it caches the binary, then when the macos-latest runs it uses the cached binary and works.

So the issue is that it's trying to download ARM64 for macos when it needs to use x64.

@na4ma4
Copy link
Author

na4ma4 commented Oct 29, 2024

https://github.com/magefile/mage-action/blob/master/src/installer.ts#L103-L108

const getFilename = (semver: string): string => {
  const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'macOS' : 'Linux';
  const arch: string = osArch == 'x64' ? '64bit' : osArch == 'arm64' ? 'ARM64' : '32bit';
  const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
  return util.format('mage_%s_%s-%s.%s', semver, platform, arch, ext);
};

might need something like

const getFilename = (semver: string): string => {
  const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'macOS' : 'Linux';
  const arch: string = osPlat == 'darwin' && osArch == 'arm64' ? '64bit' : osArch == 'x64' ? '64bit' : osArch == 'arm64' ? 'ARM64' : '32bit';
  const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
  return util.format('mage_%s_%s-%s.%s', semver, platform, arch, ext);
};

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

No branches or pull requests

2 participants