diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d27fa54..5108954f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,17 +12,16 @@ jobs: matrix: go: [1.17] platform: [ubuntu-latest, macos-11] - arch: [x86_64, arm64] runs-on: ${{ matrix.platform }} steps: - # - name: Arm Build - # if: matrix.platform == 'ubuntu-latest' && matrix.arch == 'x86_64' - # run: | - # sudo apt-get update - # sudo apt-get install -y libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev bc - # sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi - # sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf - # sudo apt-get install -y g++-aarch64-linux-gnu crossbuild-essential-arm64 + - name: Arm Build + if: matrix.platform == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev bc + sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi + sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf + sudo apt-get install -y g++-aarch64-linux-gnu crossbuild-essential-arm64 - name: Setup Cache uses: actions/cache@v2 @@ -96,11 +95,11 @@ jobs: - name: Make Artifacts Linux if: matrix.platform == 'ubuntu-latest' run: | - make artifact-linux + make artifacts-linux - name: Make Artifacts MacOS if: matrix.platform == 'macos-11' run: | - make artifact-macos + make artifacts-macos - name: Push to Station (@Silicon Valley) uses: nogsantos/scp-deploy@master diff --git a/Makefile b/Makefile index e64fafbb..048baf1d 100644 --- a/Makefile +++ b/Makefile @@ -248,8 +248,8 @@ linux: clean mv .tmp/xiang-*-* dist/release/ chmod +x dist/release/xiang-*-* -.PHONY: artifact-linux -artifact-linux: clean +.PHONY: artifacts-linux +artifacts-linux: clean mkdir -p dist/release # UI制品 @@ -266,18 +266,17 @@ artifact-linux: clean # 制品 mkdir -p dist - CGO_ENABLED=1 CGO_LDFLAGS="-static" go build -v -o dist/yao-${VERSION}-linux-${RUNNER_ARCH} -# CGO_ENABLED=1 CGO_LDFLAGS="-static" GOOS=linux GOARCH=amd64 go build -v -o dist/yao-${VERSION}-linux-amd64 -# CGO_ENABLED=1 CGO_LDFLAGS="-static" GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ go build -v -o dist/yao-${VERSION}-linux-arm64 + CGO_ENABLED=1 CGO_LDFLAGS="-static" GOOS=linux GOARCH=amd64 go build -v -o dist/yao-${VERSION}-linux-amd64 + CGO_ENABLED=1 CGO_LDFLAGS="-static" GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ go build -v -o dist/yao-${VERSION}-linux-arm64 mkdir -p dist/release mv dist/yao-*-* dist/release/ chmod +x dist/release/yao-*-* ls -l dist/release/ - dist/release/yao-${VERSION}-linux-${RUNNER_ARCH} version + dist/release/yao-${VERSION}-linux-amd64 version -.PHONY: artifact-macos -artifact-macos: clean +.PHONY: artifacts-macos +artifacts-macos: clean mkdir -p dist/release # UI制品 @@ -294,15 +293,14 @@ artifact-macos: clean # 制品 mkdir -p dist - CGO_ENABLED=1 go build -v -o dist/yao-${VERSION}-darwin-${RUNNER_ARCH} -# CGO_ENABLED=1 CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o dist/yao-${VERSION}-darwin-amd64 -# CGO_ENABLED=1 CGO_LDFLAGS="-static" GOOS=darwin GOARCH=arm64 go build -v -o dist/yao-${VERSION}-linux-arm64 + CGO_ENABLED=1 CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o dist/yao-${VERSION}-darwin-amd64 + CGO_ENABLED=1 CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -v -o dist/yao-${VERSION}-darwin-arm64 mkdir -p dist/release mv dist/yao-*-* dist/release/ chmod +x dist/release/yao-*-* ls -l dist/release/ - dist/release/yao-${VERSION}-darwin-${RUNNER_ARCH} version + dist/release/yao-${VERSION}-darwin-arm64 version .PHONY: win32 win32: bindata diff --git a/share/const.go b/share/const.go index 7b4c367d..0f6f33a0 100644 --- a/share/const.go +++ b/share/const.go @@ -4,7 +4,7 @@ package share // session -> freeport fix bug // 更新制品目录 -> ui/downloads // Arm64 制品 -> arm build test -// MacOS 制品 -> debug 4 +// MacOS 制品 -> debug 5 // VERSION 版本号 const VERSION = "0.9.1"