Skip to content

Commit

Permalink
try crazy-max/ghaction-xgo@v3
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyxu committed Jan 30, 2024
1 parent b03f1b9 commit 50defa5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Benchmark

# on:
on:
# push:
# pull_request:
pull_request:

jobs:

Expand Down
37 changes: 22 additions & 15 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@ name: Release

on:
push:
tags:
- "v*.*.*"
# tags:
# - "v*.*.*"

jobs:
Release-cli:
strategy:
matrix:
include:
- os: [windows-latest, self-hosted, x64]
- os: [macos-latest, self-hosted, x64]
- os: [ubuntu-latest, self-hosted, x64]
- os: [ubuntu-latest, self-hosted, ARM64]
- os: [ubuntu-latest, self-hosted, ARM32]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,15 +17,30 @@ jobs:
go-version: ^1.21
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Build
run: |
bash scripts.sh build server
# - name: Build server:except-go
# run: |
# bash scripts.sh build server:except-go
- name: Build go files
uses: crazy-max/ghaction-xgo@v3
with:
xgo_version: latest
go_version: 1.21
pkg: /build/cmd/kfs-server
dest: build
prefix: kfs-server
targets: windows/amd64,linux/amd64,linux/arm64,linux/arm,darwin/arm64,darwin/amd64
v: true
x: true
race: false
ldflags: -s -w
buildmode: default
trimpath: true
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
cmd/kfs-server/kfs-server-${{ matrix.os }}-${{ matrix.arch }}
cmd/kfs-server/kfs-server*
Release-electron:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: UnitTest

# on:
on:
# push:
# pull_request:
pull_request:

jobs:

Expand Down
18 changes: 18 additions & 0 deletions scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -e

root=$(cd "$(dirname "$0")"; pwd)

echo "root: "$root

is_command_exist () {
which $1 >/dev/null 2>&1
}
Expand Down Expand Up @@ -122,6 +124,22 @@ case $1 in
CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH go build -o kfs-server-$GOOS-$GOARCH
;;

server:except-go)
cd $root/ui/web
yarn
yarn build
cd $root/cmd/kfs-server
echo "GOOS=$GOOS GOARCH=$GOARCH"
if [[ $GOOS == '' ]]; then
GOOS=`go env GOOS`
fi
if [[ $GOARCH == '' ]]; then
GOARCH=`go env GOARCH`
fi
echo "GOOS=$GOOS GOARCH=$GOARCH"
# CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH go build -o kfs-server-$GOOS-$GOARCH
;;

cli)
cd $root/cmd/kfs-cli
echo "GOOS=$GOOS GOARCH=$GOARCH"
Expand Down

0 comments on commit 50defa5

Please sign in to comment.