Switch hf-hub to rustls-tls to fix musl build #22
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: | |
| tag: | |
| description: 'Tag to release (e.g., v0.2.3)' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| os: macos-15 | |
| name: sediment-x86_64-apple-darwin | |
| - target: aarch64-apple-darwin | |
| os: macos-14 | |
| name: sediment-aarch64-apple-darwin | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: sediment-x86_64-unknown-linux-gnu | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| name: sediment-x86_64-unknown-linux-musl | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install protoc | |
| uses: arduino/setup-protoc@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install cross | |
| if: contains(matrix.target, 'musl') | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build (musl with cross) | |
| if: contains(matrix.target, 'musl') | |
| run: cross build --release --target ${{ matrix.target }} | |
| - name: Build (non-musl) | |
| if: ${{ !contains(matrix.target, 'musl') }} | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Package | |
| run: | | |
| mkdir -p dist | |
| cp target/${{ matrix.target }}/release/sediment dist/ | |
| cd dist | |
| tar -czvf ../${{ matrix.name }}.tar.gz sediment | |
| cd .. | |
| shasum -a 256 ${{ matrix.name }}.tar.gz > ${{ matrix.name }}.tar.gz.sha256 | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }} | |
| files: | | |
| ${{ matrix.name }}.tar.gz | |
| ${{ matrix.name }}.tar.gz.sha256 | |
| checksums: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download SHA256 files | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release download ${{ github.ref_name }} \ | |
| --repo ${{ github.repository }} \ | |
| --pattern "*.sha256" | |
| - name: Generate checksums.txt | |
| run: | | |
| cat *.sha256 > checksums.txt | |
| - name: Upload checksums.txt | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: checksums.txt | |
| publish-crate: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install protoc | |
| uses: arduino/setup-protoc@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to crates.io | |
| run: cargo publish | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| update-homebrew: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| # Only update homebrew for stable releases (no alpha/beta/rc) | |
| if: ${{ !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') }} | |
| steps: | |
| - name: Get version | |
| id: version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Download SHA256 files | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release download v${{ steps.version.outputs.version }} \ | |
| --repo ${{ github.repository }} \ | |
| --pattern "*.sha256" | |
| - name: Clone homebrew-tap | |
| env: | |
| HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| run: | | |
| git clone https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/rendro/homebrew-tap.git | |
| - name: Update formula | |
| env: | |
| VERSION: ${{ steps.version.outputs.version }} | |
| run: | | |
| SHA_INTEL=$(cat sediment-x86_64-apple-darwin.tar.gz.sha256 | awk '{print $1}') | |
| SHA_ARM=$(cat sediment-aarch64-apple-darwin.tar.gz.sha256 | awk '{print $1}') | |
| SHA_LINUX=$(cat sediment-x86_64-unknown-linux-musl.tar.gz.sha256 | awk '{print $1}') | |
| cat > homebrew-tap/Formula/sediment.rb <<EOF | |
| class Sediment < Formula | |
| desc "Semantic memory for AI agents - local-first, MCP-native" | |
| homepage "https://github.com/rendro/sediment" | |
| version "$VERSION" | |
| on_macos do | |
| on_intel do | |
| url "https://github.com/rendro/sediment/releases/download/v#{version}/sediment-x86_64-apple-darwin.tar.gz" | |
| sha256 "$SHA_INTEL" | |
| end | |
| on_arm do | |
| url "https://github.com/rendro/sediment/releases/download/v#{version}/sediment-aarch64-apple-darwin.tar.gz" | |
| sha256 "$SHA_ARM" | |
| end | |
| end | |
| on_linux do | |
| on_intel do | |
| url "https://github.com/rendro/sediment/releases/download/v#{version}/sediment-x86_64-unknown-linux-musl.tar.gz" | |
| sha256 "$SHA_LINUX" | |
| end | |
| end | |
| def install | |
| bin.install "sediment" | |
| end | |
| test do | |
| assert_match "sediment", shell_output("#{bin}/sediment --help") | |
| end | |
| end | |
| EOF | |
| # Remove leading whitespace from formula | |
| sed -i 's/^ //' homebrew-tap/Formula/sediment.rb | |
| - name: Commit and push | |
| run: | | |
| cd homebrew-tap | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Formula/sediment.rb | |
| git commit -m "Update sediment to v${{ steps.version.outputs.version }}" | |
| git push |