ci: fix release job (#1519)

* ci: remove CGO_ENABLE=0 due to blst package
* ci: fix arm binary build
* ci: remove arm5-7 version
* ci: fix arm64 build script
* ci: fix generate_change_log.sh
This commit is contained in:
dylanhuang 2023-04-24 22:30:27 +08:00 committed by GitHub
parent b6274dd2df
commit 282ef8952d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 81 additions and 142 deletions

@ -24,26 +24,20 @@ TESTNET_ZIP_SUM="$(checksum ./testnet.zip)"
LINUX_BIN_SUM="$(checksum ./linux/geth)"
MAC_BIN_SUM="$(checksum ./macos/geth)"
WINDOWS_BIN_SUM="$(checksum ./windows/geth.exe)"
ARM5_BIN_SUM="$(checksum ./arm5/geth-linux-arm-5)"
ARM6_BIN_SUM="$(checksum ./arm6/geth-linux-arm-6)"
ARM7_BIN_SUM="$(checksum ./arm7/geth-linux-arm-7)"
ARM64_BIN_SUM="$(checksum ./arm64/geth-linux-arm64)"
OUTPUT=$(cat <<-END
## Changelog\n
${CHANGE_LOG}\n
## Assets\n
| Assets | Sha256 Checksum |\n
| :-----------: |------------|\n
| mainnet.zip | ${MAINNET_ZIP_SUM} |\n
| testnet.zip | ${TESTNET_ZIP_SUM} |\n
| geth_linux | ${LINUX_BIN_SUM} |\n
| geth_mac | ${MAC_BIN_SUM} |\n
| geth_windows | ${WINDOWS_BIN_SUM} |\n
| geth_linux_arm-5 | ${ARM5_BIN_SUM} |\n
| geth_linux_arm-6 | ${ARM6_BIN_SUM} |\n
| geth_linux_arm-7 | ${ARM7_BIN_SUM} |\n
| Assets | Sha256 Checksum |
| :-----------: |------------|
| mainnet.zip | ${MAINNET_ZIP_SUM} |
| testnet.zip | ${TESTNET_ZIP_SUM} |
| geth_linux | ${LINUX_BIN_SUM} |
| geth_mac | ${MAC_BIN_SUM} |
| geth_windows | ${WINDOWS_BIN_SUM} |
| geth_linux_arm64 | ${ARM64_BIN_SUM} |\n
END
)
echo -e ${OUTPUT}
echo -e "${OUTPUT}"

@ -44,8 +44,17 @@ jobs:
# ==============================
- name: Build Binary for ${{matrix.os}}
env:
CGO_ENABLED: "0"
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
wget https://musl.cc/x86_64-linux-musl-cross.tgz
tar -xvf ./x86_64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=$(pwd)/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth -a ./cmd/geth
- name: Build Binary for ${{matrix.os}}
if: matrix.os != 'ubuntu-latest'
run: |
go mod download
make geth
@ -58,7 +67,12 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
make geth-linux-arm
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xvf ./aarch64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth-linux-arm64 -a ./cmd/geth
# ==============================
# Upload artifacts
# ==============================
@ -84,27 +98,6 @@ jobs:
name: windows
path: ./build/bin/geth.exe
- name: Upload ARM-5 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm5
path: ./build/bin/geth-linux-arm-5
- name: Upload ARM-6 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm6
path: ./build/bin/geth-linux-arm-6
- name: Upload ARM-7 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm7
path: ./build/bin/geth-linux-arm-7
- name: Upload ARM-64 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
@ -145,24 +138,6 @@ jobs:
name: windows
path: ./windows
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm5
path: ./arm5
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm6
path: ./arm6
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm7
path: ./arm7
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
@ -204,7 +179,4 @@ jobs:
./linux/geth_linux
./macos/geth_macos
./windows/geth_windows.exe
./arm5/geth-linux-arm-5
./arm6/geth-linux-arm-6
./arm7/geth-linux-arm-7
./arm64/geth-linux-arm64

@ -44,8 +44,17 @@ jobs:
# ==============================
- name: Build Binary for ${{matrix.os}}
env:
CGO_ENABLED: "0"
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
wget https://musl.cc/x86_64-linux-musl-cross.tgz
tar -xvf ./x86_64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=$(pwd)/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth -a ./cmd/geth
- name: Build Binary for ${{matrix.os}}
if: matrix.os != 'ubuntu-latest'
run: |
go mod download
make geth
@ -58,7 +67,12 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
make geth-linux-arm
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xvf ./aarch64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth-linux-arm64 -a ./cmd/geth
# ==============================
# Upload artifacts
# ==============================
@ -84,27 +98,6 @@ jobs:
name: windows
path: ./build/bin/geth.exe
- name: Upload ARM-5 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm5
path: ./build/bin/geth-linux-arm-5
- name: Upload ARM-6 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm6
path: ./build/bin/geth-linux-arm-6
- name: Upload ARM-7 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm7
path: ./build/bin/geth-linux-arm-7
- name: Upload ARM-64 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
@ -145,24 +138,6 @@ jobs:
name: windows
path: ./windows
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm5
path: ./arm5
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm6
path: ./arm6
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm7
path: ./arm7
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
@ -211,7 +186,4 @@ jobs:
./linux/geth_linux
./macos/geth_macos
./windows/geth_windows.exe
./arm5/geth-linux-arm-5
./arm6/geth-linux-arm-6
./arm7/geth-linux-arm-7
./arm64/geth-linux-arm64

@ -13,8 +13,6 @@ COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download
ADD . /go-ethereum
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth
# Pull Geth into a second stage deploy alpine container
@ -28,10 +26,9 @@ ENV BSC_HOME=/bsc
ENV HOME=${BSC_HOME}
ENV DATA_DIR=/data
ARG VERSION_GCC=11.2.1_git20220219-r2
ENV PACKAGES ca-certificates jq \
bash bind-tools tini \
grep curl sed gcc==${VERSION_GCC}
grep curl sed gcc
RUN apk add --no-cache $PACKAGES \
&& rm -rf /var/cache/apk/* \
@ -59,4 +56,7 @@ USER ${BSC_USER_UID}:${BSC_USER_GID}
# rpc ws graphql
EXPOSE 8545 8546 8547 30303 30303/udp
# For blst runtime env
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
ENTRYPOINT ["/sbin/tini", "--", "./docker-entrypoint.sh"]

@ -29,3 +29,7 @@ ARG VERSION=""
ARG BUILDNUM=""
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"
# For blst runtime env
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"

@ -4,7 +4,6 @@
.PHONY: geth android ios evm all test truffle-test clean
.PHONY: docker
.PHONY: geth-linux-arm geth-linux-arm64 geth-linux-arm5 geth-linux-arm6 geth-linux-arm7
GOBIN = ./build/bin
GO ?= latest
@ -17,23 +16,6 @@ geth:
@echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth."
ldflags = -X main.gitCommit=$(GIT_COMMIT) \
-X main.gitDate=$(GIT_COMMIT_DATE)
geth-linux-arm: geth-linux-arm5 geth-linux-arm6 geth-linux-arm7 geth-linux-arm64
geth-linux-arm5:
env GO111MODULE=on GOARCH=arm GOARM=5 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-5 ./cmd/geth
geth-linux-arm6:
env GO111MODULE=on GOARCH=arm GOARM=6 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-6 ./cmd/geth
geth-linux-arm7:
env GO111MODULE=on GOARCH=arm GOARM=7 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-7 ./cmd/geth
geth-linux-arm64:
env GO111MODULE=on GOARCH=arm64 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm64 ./cmd/geth
all:
$(GORUN) build/ci.go install

@ -142,6 +142,16 @@ Download latest chaindata snapshot from [here](https://github.com/bnb-chain/bsc-
./geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --txlookuplimit 0 --tries-verify-mode none
```
if you get such error:
```shell
Caught SIGILL in blst_cgo_init, consult <blst>/bindinds/go/README.md.
```
please try to add the following environment variables:
```shell
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
export CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
```
#### 5. Monitor node status
Monitor the log from **./node/bsc.log** by default. When the node has started syncing, should be able to see the following output:

@ -24,19 +24,18 @@ Usage: go run build/ci.go <command> <command flags/arguments>
Available commands are:
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore
For all commands, -n prevents execution of external programs (dry run mode).
*/
package main
@ -198,9 +197,10 @@ func main() {
func doInstall(cmdline []string) {
var (
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
arch = flag.String("arch", "", "Architecture to cross build for")
cc = flag.String("cc", "", "C compiler to cross build with")
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
arch = flag.String("arch", "", "Architecture to cross build for")
cc = flag.String("cc", "", "C compiler to cross build with")
output = flag.String("o", "", "Output directory for build artifacts")
)
flag.CommandLine.Parse(cmdline)
@ -213,7 +213,8 @@ func doInstall(cmdline []string) {
// Configure the build.
env := build.Env()
gobuild := tc.Go("build", buildFlags(env)...)
buildArgs := buildFlags(env)
gobuild := tc.Go("build", buildArgs...)
// arm64 CI builders are memory-constrained and can't handle concurrent builds,
// better disable it. This check isn't the best, it should probably
@ -239,7 +240,11 @@ func doInstall(cmdline []string) {
for _, pkg := range packages {
args := make([]string, len(gobuild.Args))
copy(args, gobuild.Args)
args = append(args, "-o", executablePath(path.Base(pkg)))
outputPath := executablePath(path.Base(pkg))
if output != nil && *output != "" {
outputPath = *output
}
args = append(args, "-o", outputPath)
args = append(args, pkg)
build.MustRun(&exec.Cmd{Path: gobuild.Path, Args: args, Env: gobuild.Env})
}