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', 'arm64',
] ]
await Promise.all( await $`go test ./...`
goos.flatMap(GOOS =>
goarch.map(GOARCH => let name = (GOOS, GOARCH) => `fx_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '')
$`GOOS=${GOOS} GOARCH=${GOARCH} go build -o fx_${GOOS}_${GOARCH}`)))
await Promise.all( await Promise.all(
goos.flatMap(GOOS => goos.flatMap(GOOS =>
goarch.map(GOARCH => 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 - name: Build and Release
env: env:
FORCE_COLOR: 3 FORCE_COLOR: 3
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx zx .github/workflows/release.mjs run: npx zx .github/workflows/release.mjs