Update release script

This commit is contained in:
Anton Medvedev 2022-04-20 23:16:58 +02:00
parent d7f54a5c80
commit 0d556edd9e
2 changed files with 10 additions and 5 deletions

View File

@ -8,12 +8,16 @@ let goarch = [
'arm64',
]
await Promise.all(
goos.flatMap(GOOS =>
goarch.map(GOARCH =>
$`GOOS=${GOOS} GOARCH=${GOARCH} go build -o fx_${GOOS}_${GOARCH}`)))
await $`go test ./...`
let name = (GOOS, GOARCH) => `fx_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '')
await Promise.all(
goos.flatMap(GOOS =>
goarch.map(GOARCH =>
$`gh release upload ${process.env.RELEASE_VERSION} fx_${GOOS}_${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)}`)))

View File

@ -23,4 +23,5 @@ jobs:
- name: Build and Release
env:
FORCE_COLOR: 3
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx zx .github/workflows/release.mjs