Add release script

This commit is contained in:
Anton Medvedev 2022-04-20 23:08:59 +02:00
parent 804becbdb5
commit d7f54a5c80
2 changed files with 24 additions and 5 deletions

19
.github/workflows/release.mjs vendored Normal file
View File

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

View File

@ -17,10 +17,10 @@ jobs:
with:
go-version: 1.18
- name: Build and release
- name: Version
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Build and Release
env:
FORCE_COLOR: 3
run: |
npx zx <<'EOF'
await $`go build -o fx`
EOF
run: npx zx .github/workflows/release.mjs