Skip to content

Commit

Permalink
CD 调试
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Feb 12, 2022
1 parent 7b2a2d3 commit 37bbf1f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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制品
Expand All @@ -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制品
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion share/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 37bbf1f

Please sign in to comment.