Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
doitian committed Apr 1, 2024
2 parents 872c580 + f9e2583 commit 964c8b7
Show file tree
Hide file tree
Showing 120 changed files with 10,722 additions and 11,036 deletions.
2 changes: 2 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
80 changes: 48 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,71 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-latest, macos-11, windows-latest ]
steps:
- uses: actions/checkout@v2
- if: matrix.os == 'windows-latest'
name: Windows Dependencies
run: |
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop install yasm
echo ("PATH=" + $env:PATH + ";" + $env:USERPROFILE + "\scoop\shims;C:\msys64\mingw64\bin") >> $env:GITHUB_ENV
- name: UnitTest
run: make test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.71.1
- if: matrix.os == 'windows-latest'
name: Windows Dependencies
shell: pwsh
run: |
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop install mingw git
- name: UnitTest
shell: pwsh
run: |
make test
git diff
integration-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ ubuntu-latest, macos-11 ]
steps:
- uses: actions/checkout@v2
- name: Integration_Test
run: make integration
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.71.1
- name: Integration_Test
run: make integration

linters:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ ubuntu-latest, macos-11 ]
steps:
- uses: actions/checkout@v2
- name: Linters
run: |
cargo fmt --version || rustup component add rustfmt
cargo clippy --version || rustup component add clippy
make fmt
make clippy
git diff --exit-code Cargo.lock
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.71.1
- name: Linters
run: |
cargo fmt --version || rustup component add rustfmt
cargo clippy --version || rustup component add clippy
make fmt
make clippy
git diff --exit-code Cargo.lock
security-audit:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- --hide-inclusion-graph --show-stats advisories sources
- --hide-inclusion-graph --show-stats bans
- --hide-inclusion-graph --show-stats licenses
steps:
- uses: actions/checkout@v2
- name: Security Audit & Licenses
run: |
rustup toolchain install nightly --allow-downgrade --profile minimal
cargo deny --version || cargo +nightly install cargo-deny --locked
make security-audit
make check-crates
make check-licenses
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.71.1
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}

ci-success:
name: ci
Expand Down
119 changes: 110 additions & 9 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Package

permissions:
# for actions/create-release, actions/upload-release-asset
contents: write

concurrency:
group: package-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -51,7 +55,7 @@ jobs:
GPG_SIGNER: ${{ secrets.GPG_SIGNER }}
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli -e OPENSSL_STATIC=1 $BUILDER_IMAGE make prod
docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli $BUILDER_IMAGE make prod
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
devtools/ci/package.sh target/release/ckb-cli
Expand All @@ -68,9 +72,48 @@ jobs:
name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.51.0
BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.71.1-openssl-3.1.3
REL_PKG: x86_64-unknown-linux-gnu.tar.gz

package-for-linux-aarch64:
name: package-for-linux-aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Env
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV
- name: Add rust target
run: rustup target add aarch64-unknown-linux-gnu
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y gcc-multilib && sudo apt-get install -y build-essential clang gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Build and package ckb-cli (aarch64)
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
GPG_SIGNER: ${{ secrets.GPG_SIGNER }}
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
export TOP_DIR=$(pwd)
PKG_CONFIG_ALLOW_CROSS=1 CC=gcc CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc cargo build --target=aarch64-unknown-linux-gnu --release
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
devtools/ci/package.sh target/aarch64-unknown-linux-gnu/release/ckb-cli
mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }}
mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }}
- name: upload-zip-file
uses: actions/upload-artifact@v2
with:
name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}
path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}
- name: upload-asc-file
uses: actions/upload-artifact@v2
with:
name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
REL_PKG: aarch64-unknown-linux-gnu.tar.gz

package-for-centos:
name: package-for-centos
runs-on: ubuntu-latest
Expand Down Expand Up @@ -103,12 +146,12 @@ jobs:
name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.51.0
BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.71.1-openssl-3.1.3
REL_PKG: x86_64-unknown-centos-gnu.tar.gz

package-for-mac:
name: package-for-mac
runs-on: macos-latest
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Set Env
Expand All @@ -121,7 +164,7 @@ jobs:
GPG_SIGNER: ${{ secrets.GPG_SIGNER }}
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/local/opt/[email protected]/lib OPENSSL_INCLUDE_DIR=/usr/local/opt/[email protected]/include prod
make prod
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
devtools/ci/package.sh target/release/ckb-cli
Expand All @@ -140,19 +183,73 @@ jobs:
env:
REL_PKG: x86_64-apple-darwin.zip

package-for-mac-aarch64:
name: package-for-mac-aarch64
runs-on: [self-hosted, macOS, ARM64]
steps:
- name: Setup PATH
run: |
echo /opt/homebrew/bin >> $GITHUB_PATH
echo /opt/homebrew/sbin >> $GITHUB_PATH
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Depedencies
run: |
if ! [ -d /opt/homebrew/opt/[email protected] ]; then
brew install "[email protected]"
fi
if ! type -f gpg &> /dev/null; then
brew install gnupg
fi
if ! [ -f "$HOME/.cargo/bin/rustup" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
- uses: actions/checkout@v2
- name: Set Env
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV
- name: Build and package ckb-cli
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
GPG_SIGNER: ${{ secrets.GPG_SIGNER }}
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
make prod
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
devtools/ci/package.sh target/release/ckb-cli
mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }}
mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }}
- name: upload-zip-file
uses: actions/upload-artifact@v2
with:
name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}
path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}
- name: upload-asc-file
uses: actions/upload-artifact@v2
with:
name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
REL_PKG: aarch64-apple-darwin.zip

package-for-windows:
name: package-for-windows
runs-on: windows-latest
runs-on: windows-2019
steps:
- name: Install Dependencies
run: |
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
iwr -useb get.scoop.sh -outfile 'install-scoop.ps1'
.\install-scoop.ps1 -RunAsAdmin
echo "LIBCLANG_PATH=$($HOME)/scoop/apps/llvm/current/bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop install llvm yasm
echo ("GIT_TAG_NAME=" + $env:GITHUB_REF.replace('refs/heads/pkg/', '')) >> $env:GITHUB_ENV
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "LIBCLANG_PATH=$env:USERPROFILE\scoop\apps\llvm\13.0.0\bin" >> $env:GITHUB_ENV
echo "LIBCLANG_PATH=$env:USERPROFILE\scoop\apps\llvm\current\bin" >> $env:GITHUB_ENV
- uses: actions/checkout@v2
- name: Build
run: |
Expand Down Expand Up @@ -196,13 +293,17 @@ jobs:
matrix:
include:
- REL_PKG: x86_64-unknown-linux-gnu.tar.gz
- REL_PKG: aarch64-unknown-linux-gnu.tar.gz
- REL_PKG: x86_64-unknown-centos-gnu.tar.gz
- REL_PKG: x86_64-apple-darwin.zip
- REL_PKG: aarch64-apple-darwin.zip
- REL_PKG: x86_64-pc-windows-msvc.zip
needs:
- create-release
- package-for-linux
- package-for-linux-aarch64
- package-for-mac
- package-for-mac-aarch64
- package-for-windows
- package-for-centos
steps:
Expand Down
57 changes: 55 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,60 @@
# v1.4.0
* Update ckb deps from `v0.105.1` to `v0.106.0`
* Update dep ckb-sdk to `v2.4.0`

Version 0.15.0
==============
# v1.3.0
* Add deploy subcommand, this is a more advanced version of `capsule deploy` #515
- more resonable CKB transaction structure
- support `multisig` lock
* Add `--max-tx-fee` argument to subcommands, so that you can transfer all your CKB to another address more easy #517
- `wallet transfer`
- `sudt`
- `dao`

# v1.2.0
* Update ckb deps from `v0.104.0` to `v0.105.1`
* Update deps
- ckb-sdk to `v2.3.0`
- secp256k1 to `v0.24`
- bitcoin to `v0.27`
* Support ckb-indexer rpc from ckb node
* Add `account bitcoin-xpub` subcommand

# v1.1.0
* Update ckb deps from `v0.103.0` to `v0.104.0`
* **BREAKING**: remove `ckb-index` crate, and effect following subcommands:
- remove `index` subcommand
- remove `wallet top-capacity` subcommand
- remove `wallet get-capacity --lock-hash` support
- remove `wallet get-live-cells --lock-hash` support
- remove `wallet get-live-cells --type-hash` support
- remove `wallet get-live-cells --code-hash` support
* Use [`ckb-indexer`][ckb-indexer-repo] as index backend
* Update `ckb-sdk` to `v2.0.0`
* Guide user to select ckb/ckb-indexer url for the first time
* Add `--local-only` flag to not check alerts and get network type when startup

# v1.0.0
* Update ckb from `v0.101.3` to `v0.103.0`
* Remove `ckb-sdk` from `ckb-cli` and created as an [standalone repository](https://github.com/nervosnetwork/ckb-sdk-rust)
* Add `ckb-signer` sub-crate for keystore implementation
* Use new `ckb-sdk` to refactor:
- `wallet transfer`
- `dao deposit`
- `dao prepare`
- `dao withdraw`
* Replace `tx-fee` argument with `fee-rate` argument and the default value is `1000`'
* Refactor `AddressParser`
* Add [`sudt`][sudt-wiki] subcommand
* Short address use ckb2021 address format

* * * * *

# v0.15.0
* Compatible with ckb-v0.15.z
* Use rocksdb as index database backend
* Add web3 v3 keystore support


[sudt-wiki]: https://github.com/nervosnetwork/ckb-cli/wiki/UDT-(sudt)-Operations-Tutorial
[ckb-indexer-repo]: https://github.com/nervosnetwork/ckb-indexer
Loading

0 comments on commit 964c8b7

Please sign in to comment.