release #21
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - "cli/v*" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/cli | |
| outputs: | |
| version: ${{ steps.version.outputs.value }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "value=${GITHUB_REF_NAME#cli/}" >> $GITHUB_OUTPUT | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt, clippy | |
| - name: Clone dependency repos | |
| run: | | |
| mkdir -p /home/runner/work/packages | |
| git clone --depth 1 https://github.com/quanttide/quanttide-agent-toolkit.git /home/runner/work/packages/quanttide-agent-toolkit | |
| git clone --depth 1 https://github.com/quanttide/quanttide-data-toolkit.git /home/runner/work/packages/quanttide-data-toolkit | |
| - name: Build | |
| run: cargo build --release | |
| - name: Test | |
| run: cargo test | |
| - name: Clippy | |
| run: cargo clippy -- -A warnings | |
| - name: Format | |
| run: cargo fmt --check | |
| publish-crate: | |
| needs: check | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/cli | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Clone dependency repos | |
| run: | | |
| mkdir -p /home/runner/work/packages | |
| git clone --depth 1 https://github.com/quanttide/quanttide-agent-toolkit.git /home/runner/work/packages/quanttide-agent-toolkit | |
| git clone --depth 1 https://github.com/quanttide/quanttide-data-toolkit.git /home/runner/work/packages/quanttide-data-toolkit | |
| - name: Publish quanttide-agent | |
| run: | | |
| cd /home/runner/work/packages/quanttide-agent-toolkit/packages/rust | |
| cargo publish --allow-dirty --token ${{ secrets.CRATES_API_TOKEN }} | |
| - name: Publish quanttide-data-core | |
| run: | | |
| cd /home/runner/work/packages/quanttide-data-toolkit/packages/rust | |
| cargo publish --allow-dirty --token ${{ secrets.CRATES_API_TOKEN }} | |
| - name: Switch deps to crates.io versions | |
| run: | | |
| sed -i 's|quanttide-agent = { path = ".*" }|quanttide-agent = "0.1"|' Cargo.toml | |
| sed -i 's|quanttide-data-core = { path = ".*" }|quanttide-data-core = "0.1"|' Cargo.toml | |
| - name: Publish qtcloud-data-cli | |
| run: cargo publish --allow-dirty --token ${{ secrets.CRATES_API_TOKEN }} | |
| build-binary: | |
| needs: check | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/cli | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Clone dependency repos | |
| run: | | |
| mkdir -p /home/runner/work/packages | |
| git clone --depth 1 https://github.com/quanttide/quanttide-agent-toolkit.git /home/runner/work/packages/quanttide-agent-toolkit | |
| git clone --depth 1 https://github.com/quanttide/quanttide-data-toolkit.git /home/runner/work/packages/quanttide-data-toolkit | |
| - name: Build binary | |
| run: cargo build --release | |
| - name: Package | |
| run: | | |
| cd target/release | |
| tar czf ../../qtcloud-data-x86_64-linux.tar.gz qtcloud-data | |
| - name: Upload to Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| src/cli/qtcloud-data-x86_64-linux.tar.gz |