diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76d06ebd..6d27fa54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,16 +12,17 @@ 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' - 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' && 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: Setup Cache uses: actions/cache@v2 @@ -95,11 +96,11 @@ jobs: - name: Make Artifacts Linux if: matrix.platform == 'ubuntu-latest' run: | - make artifacts + make artifact-linux - name: Make Artifacts MacOS if: matrix.platform == 'macos-11' run: | - make artifacts-macos + make artifact-macos - name: Push to Station (@Silicon Valley) uses: nogsantos/scp-deploy@master diff --git a/Makefile b/Makefile index 38bf34af..e64fafbb 100644 --- a/Makefile +++ b/Makefile @@ -248,8 +248,8 @@ linux: clean mv .tmp/xiang-*-* dist/release/ chmod +x dist/release/xiang-*-* -.PHONY: artifacts -artifacts: clean +.PHONY: artifact-linux +artifact-linux: clean mkdir -p dist/release # UI制品 @@ -266,17 +266,18 @@ artifacts: clean # 制品 mkdir -p dist - 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" 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 mkdir -p dist/release mv dist/yao-*-* dist/release/ chmod +x dist/release/yao-*-* ls -l dist/release/ - dist/release/yao-${VERSION}-linux-amd64 version + dist/release/yao-${VERSION}-linux-${RUNNER_ARCH} version -.PHONY: artifacts-macos -artifacts-macos: clean +.PHONY: artifact-macos +artifact-macos: clean mkdir -p dist/release # UI制品 @@ -293,13 +294,15 @@ artifacts-macos: clean # 制品 mkdir -p dist - CGO_ENABLED=1 CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o dist/yao-${VERSION}-darwin-amd64 + 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 mkdir -p dist/release mv dist/yao-*-* dist/release/ chmod +x dist/release/yao-*-* ls -l dist/release/ - dist/release/yao-${VERSION}-linux-amd64 version + dist/release/yao-${VERSION}-darwin-${RUNNER_ARCH} version .PHONY: win32 win32: bindata diff --git a/share/const.go b/share/const.go index fb6cf592..7b4c367d 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 2 +// MacOS 制品 -> debug 4 // VERSION 版本号 const VERSION = "0.9.1"