Fix Binance Spot SBE quotes stream #139
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: cli-binaries | |
| permissions: | |
| contents: read | |
| actions: read | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - nightly | |
| env: | |
| RUST_BACKTRACE: 1 | |
| BUILD_MODE: release | |
| jobs: | |
| build-linux-x86: | |
| name: build cli (linux x86_64) | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Common setup | |
| uses: ./.github/actions/common-setup | |
| with: | |
| python-version: "3.13" | |
| free-disk-space: "true" | |
| - name: Build CLI (all features) | |
| run: | | |
| cargo build --release -p nautilus-cli --bin nautilus --all-features | |
| - name: Strip binary | |
| run: | | |
| strip target/release/nautilus || true | |
| - name: Package artifact | |
| run: | | |
| set -euo pipefail | |
| TARGET_TRIPLE="x86_64-unknown-linux-gnu" | |
| STAGE_DIR="stage-cli" | |
| mkdir -p "$STAGE_DIR" dist | |
| cp target/release/nautilus "$STAGE_DIR/nautilus" | |
| cp -L crates/cli/LICENSE "$STAGE_DIR/LICENSE" || cp -L LICENSE "$STAGE_DIR/LICENSE" | |
| cp crates/cli/README.md "$STAGE_DIR/README.md" | |
| tar -C "$STAGE_DIR" -czf "dist/nautilus-${TARGET_TRIPLE}.tar.gz" . | |
| rm -rf "$STAGE_DIR" | |
| - name: Smoke test --version | |
| run: | | |
| target/release/nautilus --version || (echo "Smoke test failed" && exit 1) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: nautilus-x86_64-unknown-linux-gnu.tar.gz | |
| path: dist/nautilus-x86_64-unknown-linux-gnu.tar.gz | |
| build-linux-arm64: | |
| name: build cli (linux aarch64) | |
| runs-on: ubuntu-22.04-arm | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Common setup | |
| uses: ./.github/actions/common-setup | |
| with: | |
| python-version: "3.13" | |
| free-disk-space: "true" | |
| - name: Build CLI (all features) | |
| run: | | |
| cargo build --release -p nautilus-cli --bin nautilus --all-features | |
| - name: Strip binary | |
| run: | | |
| strip target/release/nautilus || true | |
| - name: Package artifact | |
| run: | | |
| set -euo pipefail | |
| TARGET_TRIPLE="aarch64-unknown-linux-gnu" | |
| STAGE_DIR="stage-cli" | |
| mkdir -p "$STAGE_DIR" dist | |
| cp target/release/nautilus "$STAGE_DIR/nautilus" | |
| cp -L crates/cli/LICENSE "$STAGE_DIR/LICENSE" || cp -L LICENSE "$STAGE_DIR/LICENSE" | |
| cp crates/cli/README.md "$STAGE_DIR/README.md" | |
| tar -C "$STAGE_DIR" -czf "dist/nautilus-${TARGET_TRIPLE}.tar.gz" . | |
| rm -rf "$STAGE_DIR" | |
| - name: Smoke test --version | |
| run: | | |
| target/release/nautilus --version || (echo "Smoke test failed" && exit 1) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: nautilus-aarch64-unknown-linux-gnu.tar.gz | |
| path: dist/nautilus-aarch64-unknown-linux-gnu.tar.gz | |
| build-macos-arm64: | |
| name: build cli (macOS arm64) | |
| runs-on: macos-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Common setup | |
| uses: ./.github/actions/common-setup | |
| with: | |
| python-version: "3.13" | |
| - name: Build CLI (all features) | |
| run: | | |
| cargo build --release -p nautilus-cli --bin nautilus --all-features | |
| - name: Strip binary | |
| run: | | |
| strip target/release/nautilus || true | |
| - name: Package artifact | |
| run: | | |
| set -euo pipefail | |
| TARGET_TRIPLE="aarch64-apple-darwin" | |
| STAGE_DIR="stage-cli" | |
| mkdir -p "$STAGE_DIR" dist | |
| cp target/release/nautilus "$STAGE_DIR/nautilus" | |
| cp -L crates/cli/LICENSE "$STAGE_DIR/LICENSE" || cp -L LICENSE "$STAGE_DIR/LICENSE" | |
| cp crates/cli/README.md "$STAGE_DIR/README.md" | |
| tar -C "$STAGE_DIR" -czf "dist/nautilus-${TARGET_TRIPLE}.tar.gz" . | |
| rm -rf "$STAGE_DIR" | |
| - name: Smoke test --version | |
| run: | | |
| target/release/nautilus --version || (echo "Smoke test failed" && exit 1) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: nautilus-aarch64-apple-darwin.tar.gz | |
| path: dist/nautilus-aarch64-apple-darwin.tar.gz | |
| build-windows-x86_64: | |
| name: build cli (windows x86_64) | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Common setup | |
| uses: ./.github/actions/common-setup | |
| with: | |
| python-version: "3.13" | |
| free-disk-space: "true" | |
| - name: Build CLI (all features) | |
| run: | | |
| cargo build --release -p nautilus-cli --bin nautilus --all-features | |
| - name: Package artifact | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| $target = 'x86_64-pc-windows-msvc' | |
| New-Item -ItemType Directory -Force -Path dist | Out-Null | |
| New-Item -ItemType Directory -Force -Path stage-cli | Out-Null | |
| Copy-Item -LiteralPath target\release\nautilus.exe -Destination stage-cli\nautilus.exe | |
| Copy-Item -LiteralPath crates\cli\README.md -Destination stage-cli\README.md | |
| if (Test-Path -LiteralPath crates\cli\LICENSE) { | |
| Copy-Item -LiteralPath crates\cli\LICENSE -Destination stage-cli\LICENSE -Force | |
| } else { | |
| Copy-Item -LiteralPath LICENSE -Destination stage-cli\LICENSE -Force | |
| } | |
| Compress-Archive -Path stage-cli\* -DestinationPath dist\nautilus-$target.zip -Force | |
| Remove-Item -Recurse -Force stage-cli | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: nautilus-x86_64-pc-windows-msvc.zip | |
| path: dist/nautilus-x86_64-pc-windows-msvc.zip | |
| publish-cli: | |
| name: publish cli to R2 | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-linux-x86 | |
| - build-linux-arm64 | |
| - build-macos-arm64 | |
| - build-windows-x86_64 | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/nightly' | |
| environment: r2-nightly | |
| permissions: | |
| actions: write | |
| contents: read | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| CLOUDFLARE_R2_URL: ${{ secrets.CLOUDFLARE_R2_URL }} | |
| CLOUDFLARE_R2_REGION: "auto" | |
| CLOUDFLARE_R2_BUCKET_NAME: "packages" | |
| CLOUDFLARE_R2_PREFIX: "cli/nautilus-cli" | |
| steps: | |
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| allowed-endpoints: | | |
| ${{ vars.COMMON_ALLOWED_ENDPOINTS }} | |
| ${{ secrets.CLOUDFLARE_R2_ALLOWED_HOST }}:443 | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Download built CLI artifacts | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| path: dist/cli | |
| - name: Configure AWS CLI for Cloudflare R2 | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| echo "Configuring AWS CLI for Cloudflare R2..." | |
| # AWS CLI v2 is pre-installed on GitHub runners | |
| aws --version | |
| # Configure credentials for Cloudflare R2 | |
| mkdir -p ~/.aws | |
| { | |
| echo "[default]" | |
| echo "aws_access_key_id=${AWS_ACCESS_KEY_ID}" | |
| echo "aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}" | |
| } > ~/.aws/credentials | |
| { | |
| echo "[default]" | |
| echo "region=${CLOUDFLARE_R2_REGION:-auto}" | |
| echo "output=json" | |
| echo "s3 =" | |
| echo " signature_version = s3v4" | |
| echo " addressing_style = path" | |
| echo " payload_signing_enabled = false" | |
| echo " use_accelerate_endpoint = false" | |
| echo " use_dualstack_endpoint = false" | |
| echo " use_fips_endpoint = false" | |
| } > ~/.aws/config | |
| export AWS_EC2_METADATA_DISABLED=true | |
| - name: Upload install.sh to R2 (stable + latest) | |
| shell: bash | |
| run: | | |
| CACHE_CONTROL="no-cache, max-age=60, must-revalidate" | |
| for i in {1..5}; do | |
| if aws s3 cp scripts/cli/install.sh "s3://${CLOUDFLARE_R2_BUCKET_NAME}/${CLOUDFLARE_R2_PREFIX}/install.sh" \ | |
| --endpoint-url="${CLOUDFLARE_R2_URL}" \ | |
| --content-type "text/x-shellscript" \ | |
| --cache-control "$CACHE_CONTROL"; then | |
| break | |
| else | |
| echo "Retry ($i/5)" | |
| sleep $((2**i)) | |
| fi | |
| done | |
| for i in {1..5}; do | |
| if aws s3 cp scripts/cli/install.sh \ | |
| "s3://${CLOUDFLARE_R2_BUCKET_NAME}/${CLOUDFLARE_R2_PREFIX}/latest/install.sh" \ | |
| --endpoint-url="${CLOUDFLARE_R2_URL}" \ | |
| --content-type "text/x-shellscript" \ | |
| --cache-control "$CACHE_CONTROL"; then | |
| break | |
| else | |
| echo "Retry ($i/5)" | |
| sleep $((2**i)) | |
| fi | |
| done | |
| - name: Publish CLI binaries to R2 (versioned + latest) and generate manifest | |
| shell: bash | |
| run: | | |
| bash ./scripts/ci/publish-cli-r2-upload.sh | |
| - name: Prune old CLI versions | |
| shell: bash | |
| run: | | |
| bash ./scripts/ci/publish-cli-r2-prune.sh | |
| - name: Verify uploaded files in R2 | |
| shell: bash | |
| run: | | |
| bash ./scripts/ci/publish-cli-r2-verify.sh |