You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fx/.github/workflows/release.mjs

24 lines
501 B
JavaScript

let goos = [
'linux',
'darwin',
'windows',
]
let goarch = [
'amd64',
'arm64',
]
let name = (GOOS, GOARCH) => `fx_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '')
await $`go mod download`
await Promise.all(
goos.flatMap(GOOS =>
goarch.map(GOARCH =>
$`GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${name(GOOS, GOARCH)}`)))
await Promise.all(
goos.flatMap(GOOS =>
goarch.map(GOARCH =>
$`gh release upload ${process.env.RELEASE_VERSION} ${name(GOOS, GOARCH)}`)))