Skip to content

Commit

Permalink
Merge branch 'master' into docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ephdtrg committed Feb 8, 2023
2 parents 94df06c + ad81821 commit ec4eec4
Show file tree
Hide file tree
Showing 232 changed files with 7,591 additions and 2,926 deletions.
44 changes: 44 additions & 0 deletions .github/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const validateTypeNums = (parsedCommit) => {
const mergePrefix = "Merge pull request"
if (parsedCommit.raw.startsWith(mergePrefix)) {
console.log('this is a merge commit:' + parsedCommit.raw)
return [true,'']
}

if (!parsedCommit.type) {
return [false, 'invalid commit message, should be like "name: descriptions.", yours: "' + parsedCommit.raw + '"']
}

const types = parsedCommit.type.split(' ')
for (var i=0;i<types.length;i++){
if ((types[i].toLowerCase() == "wip") || (types[i].toLowerCase() == "r4r")) {
return [false, 'R4R or WIP is not acceptable, no matter upper case or lower case']
}
}
return [true,'']
}


module.exports = {
parserPreset: {
parserOpts: {
headerPattern: /^(.*):.*/,
}
},
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-function-rules'],
rules: {
'subject-empty':[2, 'always'],
'scope-empty':[2, 'always'],
'type-enum': [2, 'never'],
'type-case': [0, 'always'],
'function-rules/type-case': [2, 'always', validateTypeNums],
'header-max-length': [
2,
'always',
72,
],
},
helpUrl:
'https://github.com/bnb-chain/bsc/tree/develop/docs/lint/commit.md',
}
10 changes: 9 additions & 1 deletion .github/generate_change_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ 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
Expand All @@ -35,7 +39,11 @@ ${CHANGE_LOG}\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
| geth_linux_arm64 | ${ARM64_BIN_SUM} |\n
END
)

echo -e ${OUTPUT}
echo -e ${OUTPUT}
45 changes: 45 additions & 0 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint Commit Messages

on:
push:
branches:
- master
- develop

pull_request:
branches:
- master
- develop

jobs:
commitlint:
strategy:
matrix:
node-version: [14.x]
os: [ubuntu-18.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Deps
run: |
npm install -g commitlint-plugin-function-rules @commitlint/cli
npm install --save-dev commitlint-plugin-function-rules @commitlint/cli
- uses: wagoid/commitlint-github-action@v5
id: commitlint
env:
NODE_PATH: ${{ github.workspace }}/node_modules
with:
configFile: /github/workspace/.github/commitlint.config.js
104 changes: 101 additions & 3 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# ==============================
# Linux/Macos/Windows Build
# ==============================
Expand All @@ -46,6 +45,14 @@ jobs:
run: make geth

# ==============================
# Cross Compile for ARM
# ==============================

- name: Build Binary for ARM
if: matrix.os == 'ubuntu-18.04'
run: |
make geth-linux-arm
# ==============================
# Upload artifacts
# ==============================

Expand All @@ -70,6 +77,34 @@ jobs:
name: windows
path: ./build/bin/geth.exe

- name: Upload ARM-5 Build
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-18.04'
with:
name: arm5
path: ./build/bin/geth-linux-arm-5

- name: Upload ARM-6 Build
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-18.04'
with:
name: arm6
path: ./build/bin/geth-linux-arm-6

- name: Upload ARM-7 Build
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-18.04'
with:
name: arm7
path: ./build/bin/geth-linux-arm-7

- name: Upload ARM-64 Build
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-18.04'
with:
name: arm64
path: ./build/bin/geth-linux-arm64

release:
name: Release
needs: build
Expand Down Expand Up @@ -102,6 +137,30 @@ jobs:
with:
name: windows
path: ./windows

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: arm5
path: ./arm5

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: arm6
path: ./arm6

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: arm7
path: ./arm7

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: arm64
path: ./arm64

- name: Download Config File
run: |
Expand All @@ -110,7 +169,6 @@ jobs:
echo "testnet.zip url: $TESTNET_FILE_URL"
curl -L $MAINNET_FILE_URL -o ./mainnet.zip
curl -L $TESTNET_FILE_URL -o ./testnet.zip
# ==============================
# Create release
# ==============================
Expand Down Expand Up @@ -161,6 +219,46 @@ jobs:
asset_path: ./windows/geth.exe
asset_name: geth_windows.exe
asset_content_type: application/octet-stream

- name: Upload Release Asset - Linux ARM 5
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./arm5/geth-linux-arm-5
asset_name: geth-linux-arm-5
asset_content_type: application/octet-stream

- name: Upload Release Asset - Linux ARM 6
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./arm6/geth-linux-arm-6
asset_name: geth-linux-arm-6
asset_content_type: application/octet-stream

- name: Upload Release Asset - Linux ARM 7
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./arm7/geth-linux-arm-7
asset_name: geth-linux-arm-7
asset_content_type: application/octet-stream

- name: Upload Release Asset - Linux ARM 64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./arm64/geth-linux-arm64
asset_name: geth-linux-arm64
asset_content_type: application/octet-stream

- name: Upload Release Asset - MAINNET.ZIP
uses: actions/upload-release-asset@v1
Expand All @@ -180,4 +278,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./testnet.zip
asset_name: testnet.zip
asset_content_type: application/zip
asset_content_type: application/zip
Loading

0 comments on commit ec4eec4

Please sign in to comment.