Add token expiry check and refresh to all SDK examples and READMEs #173
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: Release MCP | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - build-test | |
| pull_request: {} | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| settings: | |
| - host: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| cross: true | |
| bin: longport-mcp | |
| - host: ubuntu-22.04 | |
| target: aarch64-unknown-linux-gnu | |
| cross: true | |
| bin: longport-mcp | |
| - host: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| bin: longport-mcp | |
| bin_suffix: .exe | |
| - host: macos-latest | |
| target: x86_64-apple-darwin | |
| bin: longport-mcp | |
| - host: macos-latest | |
| target: aarch64-apple-darwin | |
| bin: longport-mcp | |
| runs-on: ${{ matrix.settings.host }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| targets: ${{ matrix.settings.target }} | |
| - name: Build | |
| if: ${{ !matrix.settings.cross }} | |
| run: | | |
| cargo build --release -p longport-mcp --target ${{ matrix.settings.target }} | |
| - name: Install latest cross binary | |
| if: ${{ matrix.settings.cross }} | |
| uses: st3iny/install-cross-binary@v3 | |
| - name: Build with Cross | |
| if: ${{ matrix.settings.cross }} | |
| run: | | |
| cross build --release -p longport-mcp --target ${{ matrix.settings.target }} | |
| - name: Archive artifact | |
| if: ${{ !contains(matrix.settings.target, 'windows') }} | |
| run: | | |
| mkdir dist/ | |
| cd target/${{ matrix.settings.target }}/release | |
| tar czvf longport-mcp-${{ matrix.settings.target }}.tar.gz longport-mcp | |
| cd ../../.. | |
| mv target/${{ matrix.settings.target }}/release/longport-mcp-${{ matrix.settings.target }}.tar.gz dist/ | |
| - name: Archive artifact (Windows) | |
| if: ${{ contains(matrix.settings.target, 'windows') }} | |
| run: | | |
| mkdir dist/ | |
| cd target/${{ matrix.settings.target }}/release | |
| Compress-Archive -Path longport-mcp.exe -DestinationPath longport-mcp-${{ matrix.settings.target }}.zip | |
| cd ../../.. | |
| mv target/${{ matrix.settings.target }}/release/longport-mcp-${{ matrix.settings.target }}.zip dist/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: longport-mcp-${{ matrix.settings.target }} | |
| path: dist/ |