ci: publish multi-arch images

This commit is contained in:
xixu-me committed 2026-03-23 20:30:57 +08:00
1 parent ce0be8e0e3
commit 9eb6c6a8fa
3 files changed
+36 -7

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import { describe, expect, it } from 'bun:test'
const repoRoot = join(import.meta.dir, '..')
describe('publish image configuration', () => {
it('publishes a multi-platform image for amd64 and arm64', () => {
const workflow = readFileSync(
join(repoRoot, '.github', 'workflows', 'publish-images.yml'),
'utf8',
)
expect(workflow).toContain('platforms: linux/amd64,linux/arm64')
})
it('builds the API binary for the target image architecture', () => {
const dockerfile = readFileSync(join(repoRoot, 'Dockerfile'), 'utf8')
expect(dockerfile).toContain('ARG TARGETOS')
expect(dockerfile).toContain('ARG TARGETARCH')
expect(dockerfile).toContain('GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build')
})
})