build: Use published versions of titans_memory and hope_agents #2
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: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to release (e.g., v0.1.0)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: aingle-linux-x86_64 | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: aingle-linux-aarch64 | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| name: aingle-macos-x86_64 | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| name: aingle-macos-aarch64 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| name: aingle-windows-x86_64.exe | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libsodium-dev libssl-dev pkg-config | |
| if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| fi | |
| - name: Install system dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install libsodium openssl@3 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-${{ matrix.target }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.target }}-cargo-release- | |
| - name: Build release binary | |
| run: cargo build --release --target ${{ matrix.target }} -p aingle | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc | |
| - name: Create archive (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| mkdir -p dist | |
| cp target/${{ matrix.target }}/release/aingle dist/${{ matrix.name }} | |
| cd dist && tar -czvf ${{ matrix.name }}.tar.gz ${{ matrix.name }} | |
| - name: Create archive (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| mkdir dist | |
| copy target\${{ matrix.target }}\release\aingle.exe dist\${{ matrix.name }} | |
| cd dist && 7z a -tzip ${{ matrix.name }}.zip ${{ matrix.name }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: dist/${{ matrix.name }}.* | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| path: artifacts | |
| - name: Display structure of downloaded files | |
| run: ls -la artifacts/ | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| echo "## Changes" > CHANGELOG.md | |
| git log --pretty=format:"- %s (%h)" $(git describe --tags --abbrev=0 HEAD^)..HEAD >> CHANGELOG.md 2>/dev/null || echo "- Initial release" >> CHANGELOG.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/**/* | |
| body_path: CHANGELOG.md | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }} | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Publish to crates.io (optional, requires CARGO_REGISTRY_TOKEN secret) | |
| publish: | |
| name: Publish to crates.io | |
| needs: release | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libsodium-dev libssl-dev pkg-config | |
| - name: Publish crates (dry-run) | |
| run: | | |
| echo "Would publish the following crates:" | |
| echo "- aingle_types" | |
| echo "- aingle_keystore" | |
| echo "- aingle_state" | |
| echo "- aingle_conductor_api" | |
| echo "- aingle_websocket" | |
| echo "- aingle_p2p" | |
| echo "- aingle" | |
| echo "" | |
| echo "Skipping actual publish (requires CARGO_REGISTRY_TOKEN)" | |
| # Uncomment to enable actual publishing: | |
| # cargo publish -p aingle_types --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| # cargo publish -p aingle_keystore --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| # ... etc |