name: Release
on:
push:
tags:
- 'v*.*.*'
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-15 components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-15 components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings
test:
name: cargo test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-15 - uses: Swatinem/rust-cache@v2
- run: cargo test --workspace
docs:
name: cargo doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-15 - uses: Swatinem/rust-cache@v2
- run: cargo doc --workspace --no-deps --all-features
env:
RUSTDOCFLAGS: "-D warnings"
publish:
name: publish crates
runs-on: ubuntu-latest
needs: [fmt, clippy, test, docs]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-15 - uses: Swatinem/rust-cache@v2
- name: publish lsp-max-protocol
run: cargo publish -p lsp-max-protocol --token ${{ secrets.CARGO_TOKEN }}
continue-on-error: true
- name: wait for lsp-max-protocol
run: |
for i in {1..30}; do
if cargo search lsp-max-protocol --limit 1 2>/dev/null | grep -q "lsp-max-protocol"; then
echo "lsp-max-protocol published successfully"
break
fi
if [ $i -eq 30 ]; then
echo "Timeout waiting for lsp-max-protocol"
exit 1
fi
sleep 2
done
- name: publish lsp-max-runtime
run: cargo publish -p lsp-max-runtime --token ${{ secrets.CARGO_TOKEN }}
continue-on-error: true
- name: publish lsp-max-agent
run: cargo publish -p lsp-max-agent --token ${{ secrets.CARGO_TOKEN }}
continue-on-error: true
- name: wait for lsp-max-runtime and lsp-max-agent
run: |
for crate in lsp-max-runtime lsp-max-agent; do
for i in {1..30}; do
if cargo search "$crate" --limit 1 2>/dev/null | grep -q "$crate"; then
echo "$crate published successfully"
break
fi
if [ $i -eq 30 ]; then
echo "Timeout waiting for $crate"
exit 1
fi
sleep 2
done
done
- name: publish lsp-max-macros
run: cargo publish -p lsp-max-macros --token ${{ secrets.CARGO_TOKEN }}
continue-on-error: true
- name: wait for lsp-max-macros
run: |
for i in {1..30}; do
if cargo search lsp-max-macros --limit 1 2>/dev/null | grep -q "lsp-max-macros"; then
echo "lsp-max-macros published successfully"
break
fi
if [ $i -eq 30 ]; then
echo "Timeout waiting for lsp-max-macros"
exit 1
fi
sleep 2
done
- name: publish lsp-max
run: cargo publish -p lsp-max --token ${{ secrets.CARGO_TOKEN }}
continue-on-error: true
github-release:
name: create github release
runs-on: ubuntu-latest
needs: [publish]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-15 - uses: Swatinem/rust-cache@v2
- name: build release artifacts
run: |
mkdir -p artifacts
cargo build --release --workspace
# Copy binaries (if any exist)
for binary in $(find target/release -maxdepth 1 -type f -executable ! -name '*.d'); do
if [ -f "$binary" ]; then
cp "$binary" artifacts/
fi
done
- name: generate checksums
run: |
cd artifacts
sha256sum * > SHA256SUMS 2>/dev/null || true
cat SHA256SUMS || echo "No artifacts to checksum"
- uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: artifacts/
if-no-files-found: ignore
- name: create release
uses: softprops/action-gh-release@v1
with:
files: artifacts/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}