💚 use xgo

This commit is contained in:
naiba 2022-07-07 11:21:54 +08:00
parent 8b78cae228
commit 3ceb286f2c
2 changed files with 16 additions and 33 deletions

View File

@ -25,17 +25,25 @@ jobs:
fi
id: extract_branch
- name: xgoreleaser build
run: |
docker pull --platform linux/amd64 oryd/xgoreleaser:latest
docker run --mount type=bind,source="$(pwd)",target=/project \
--platform linux/amd64 \
-v /var/run/docker.sock:/var/run/docker.sock \
--entrypoint goreleaser \
oryd/xgoreleaser:latest --skip-publish --snapshot --rm-dist -f .goreleaser.dashboard.yml
- name: Build
uses: crazy-max/ghaction-xgo@v2
with:
xgo_version: latest
go_version: 1.18
dest: build
pkg: cmd/dashboard
prefix: dashboard
targets: linux/amd64,linux/arm64,linux/arm,linux/386,linux/s390x
v: true
x: false
race: false
ldflags: -s -w
buildmode: default
- name: move dist
run: |
ls -al dist
tree dist
mkdir -p target/linux/{arm,arm64,386,amd64,s390x}
mkdir target/linux/arm/v7/
mv dist/universal_linux_arm_7/dashboard target/linux/arm/v7/dashboard

View File

@ -1,25 +0,0 @@
before:
hooks:
- go mod tidy -v
builds:
- id: universal
env:
- CGO_ENABLED=1
flags:
- -tags
- sqlite
ldflags:
- -s -w
goos:
- linux
goarch:
- arm
- arm64
- amd64
- s390x
goarm:
- 7
gomips:
- softfloat
main: ./cmd/dashboard
binary: dashboard