Skip to content

Commit

Permalink
fix(macos): Detect x86_64 artifacts on aarch64 runners (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Apr 25, 2024
1 parent 9e6e292 commit 14e3c6c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changes/macos-x64-on-arm-runner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
action: patch
---

Fixed an issue causing x86_64 artifacts to be handled as aarch64 on GitHub's new M1 runners.
16 changes: 5 additions & 11 deletions dist/index.js

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ export function getAssetName(assetPath: string) {

let arch = '';
if (ext === '.app.tar.gz.sig' || ext === '.app.tar.gz') {
const os_arch = process.arch === 'arm64' ? '_aarch64' : '_x64';

arch = assetPath.includes('universal-apple-darwin')
? '_universal'
: assetPath.includes('aarch64-apple-darwin')
? '_aarch64'
: os_arch;
if (assetPath.includes('universal-apple-darwin')) {
arch = '_universal';
} else if (assetPath.includes('aarch64-apple-darwin')) {
arch = '_aarch64';
} else if (assetPath.includes('x86_64-apple-darwin')) {
arch = '_x64';
} else {
arch = process.arch === 'arm64' ? '_aarch64' : '_x64';
}
}

return assetPath.includes(`${path.sep}debug${path.sep}`)
Expand Down

0 comments on commit 14e3c6c

Please sign in to comment.