fx/.github/workflows/release.mjs

24 lines
501 B
JavaScript
Raw Normal View History

2022-04-20 21:08:59 +00:00
let goos = [
'linux',
'darwin',
'windows',
]
let goarch = [
'amd64',
'arm64',
]
2022-04-20 21:16:58 +00:00
let name = (GOOS, GOARCH) => `fx_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '')
2022-05-02 23:08:42 +00:00
await $`go mod download`
2022-04-25 19:41:27 +00:00
2022-04-20 21:08:59 +00:00
await Promise.all(
goos.flatMap(GOOS =>
goarch.map(GOARCH =>
2022-04-20 21:16:58 +00:00
$`GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${name(GOOS, GOARCH)}`)))
2022-04-20 21:08:59 +00:00
await Promise.all(
goos.flatMap(GOOS =>
goarch.map(GOARCH =>
2022-04-20 21:16:58 +00:00
$`gh release upload ${process.env.RELEASE_VERSION} ${name(GOOS, GOARCH)}`)))