Skip to content

feat: update prover version to 2.0.7 and sync versioning script #159

feat: update prover version to 2.0.7 and sync versioning script

feat: update prover version to 2.0.7 and sync versioning script #159

Workflow file for this run

name: Publish Rust Release
on:
pull_request:
types: [closed]
branches:
- main
jobs:
publish-release:
# Only run on merged release PRs
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch PR commits
run: |
git fetch origin ${{ github.event.pull_request.base.sha }}
git fetch origin ${{ github.event.pull_request.head.sha }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Validate packages before publishing
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
echo "========================================="
echo "Phase 1: Validation (dry-run)"
echo "========================================="
./scripts/release/validate-packages.sh "$BASE_SHA" "$HEAD_SHA"
- name: Publish packages to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
echo ""
echo "========================================="
echo "Phase 2: Publishing (atomic)"
echo "========================================="
./scripts/release/validate-packages.sh --execute "$BASE_SHA" "$HEAD_SHA"
- name: Create GitHub releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
echo ""
echo "========================================="
echo "Phase 3: Creating GitHub releases"
echo "========================================="
# Detect packages that were published
PACKAGES_STRING=$(./scripts/release/detect-version-changes.sh "$BASE_SHA" "$HEAD_SHA")
read -ra PACKAGES <<< "$PACKAGES_STRING"
for pkg in "${PACKAGES[@]}"; do
echo "----------------------------------------"
# Get the version from Cargo.toml
VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r ".packages[] | select(.name == \"$pkg\") | .version")
TAG="${pkg}-v${VERSION}"
echo "Creating GitHub release for $TAG.."
# Generate crate-specific release notes
if RELEASE_NOTES=$(./scripts/release/generate-release-notes.sh "$pkg" "$VERSION" 2>&1); then
echo "✓ Generated release notes for $pkg"
# Create release with custom notes
if echo "$RELEASE_NOTES" | gh release create "$TAG" --title "$TAG" --notes-file -; then
echo "✓ Created release for $TAG"
else
echo "Warning: Failed to create release for $TAG"
fi
else
# If script fails (e.g., no previous tag), fall back to auto-generated notes
echo "Warning: Could not generate crate-specific notes: $RELEASE_NOTES"
echo "Falling back to auto-generated notes"
if gh release create "$TAG" --generate-notes --title "$TAG"; then
echo "✓ Created release for $TAG"
else
echo "Warning: Failed to create release for $TAG"
fi
fi
done
echo ""
echo "✓ GitHub releases created"
- name: Trigger docs sync
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.DOCS_REPO_TOKEN }}
repository: Lightprotocol/docs
event-type: sync-handlers
client-payload: '{"commit": "${{ github.sha }}", "release": true}'