Skip to content

Commit 9e4eac6

Browse files
committed
Allow bottle to be (optionally) passed platform
1 parent 9a0c11f commit 9e4eac6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

actions/bottle/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ inputs:
1111
compression:
1212
description: compression to use (gz or xz)
1313
required: true
14+
platform:
15+
description: eg. darwin+aarch64
16+
required: false
1417
outputs:
1518
bottles:
1619
description: bottle files
@@ -31,3 +34,4 @@ runs:
3134
env:
3235
COMPRESSION: ${{ inputs.compression }}
3336
GPG_KEY_ID: ${{ inputs.gpg-key-id }}
37+
PLATFORM: ${{ inputs.platform }}

actions/bottle/bottle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ if (import.meta.main) {
4444

4545
//------------------------------------------------------------------------- funcs
4646
export async function bottle({ path: kegdir, pkg }: Installation, compression: 'gz' | 'xz'): Promise<Path> {
47-
const tarball = useCache().path({ pkg, type: 'bottle', compression })
47+
const [platform, arch] = Deno.env.get("PLATFORM")?.split('+') ?? []
48+
const host = platform && arch ? {platform, arch} as any : undefined
49+
const tarball = useCache().path({ pkg, type: 'bottle', compression, host })
4850
const z = compression == 'gz' ? 'z' : 'J'
4951
const cwd = usePrefix()
5052
const cmd = ["tar", `c${z}f`, tarball, kegdir.relative({ to: cwd })].map(x => x.toString())

0 commit comments

Comments
 (0)