Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/prover-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/light-prover
images: |
ghcr.io/${{ github.repository }}/light-prover
lightprotocol/prover-light
tags: |
type=match,pattern=light-prover-v(.*),group=1
type=match,pattern=light-prover-(.*),group=1
Expand Down
1 change: 1 addition & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test-ledger
/**/.DS_store
/bin
/config.json
/src/utils/proverVersion.generated.ts
5 changes: 3 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@
"scripts": {
"add-bins": "./scripts/copyLocalProgramBinaries.sh",
"postinstall": "[ -d ./bin ] && find ./bin -type f -exec chmod +x {} + || echo 'No bin directory found, skipping chmod'",
"build": "shx rm -rf dist && pnpm tsc -p tsconfig.json && pnpm tsc -p tsconfig.test.json && pnpm add-bins",
"build-release": "shx rm -rf dist && pnpm tsc -p tsconfig.json && pnpm tsc -p tsconfig.test.json && pnpm add-bins",
"sync-prover-version": "./scripts/syncProverVersion.sh",
"build": "shx rm -rf dist && pnpm sync-prover-version && pnpm tsc -p tsconfig.json && pnpm tsc -p tsconfig.test.json && pnpm add-bins",
"build-release": "shx rm -rf dist && pnpm sync-prover-version && pnpm tsc -p tsconfig.json && pnpm tsc -p tsconfig.test.json && pnpm add-bins",
"format": "pnpm prettier --write \"src/**/*.{ts,js}\" \"test/**/*.{ts,js}\" -w",
"format:check": "pnpm prettier \"src/**/*{ts,js}\" \"test/**/*.{ts,js}\" --check",
"lint": "eslint .",
Expand Down
24 changes: 24 additions & 0 deletions cli/scripts/syncProverVersion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Syncs the prover version from prover/server/VERSION to a TypeScript constant
# This script is run as part of the CLI build process

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLI_DIR="$(dirname "$SCRIPT_DIR")"
REPO_ROOT="$(dirname "$CLI_DIR")"

VERSION_FILE="$REPO_ROOT/prover/server/VERSION"
OUTPUT_FILE="$CLI_DIR/src/utils/proverVersion.generated.ts"

if [ ! -f "$VERSION_FILE" ]; then
echo "Error: VERSION file not found at $VERSION_FILE"
exit 1
fi

VERSION=$(cat "$VERSION_FILE" | tr -d '\n\r')

cat > "$OUTPUT_FILE" << EOF
// Auto-generated from prover/server/VERSION - do not edit manually
export const PROVER_VERSION = "$VERSION";
EOF

echo "Synced prover version $VERSION to $OUTPUT_FILE"
3 changes: 1 addition & 2 deletions cli/src/utils/downloadProverBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import path from "path";
import https from "https";
import http from "http";
import { pipeline } from "stream/promises";

const PROVER_VERSION = "2.0.6";
import { PROVER_VERSION } from "./proverVersion.generated";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt we commit this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, but I don't think we should.

I imagine a case like:

  1. We updated the prover to the new version
  2. We forgot to run the sync script after that
  3. CLI now requires the old/incorrect prover

const GITHUB_RELEASES_BASE_URL = `https://github.com/Lightprotocol/light-protocol/releases/download/light-prover-v${PROVER_VERSION}`;
const MAX_REDIRECTS = 10;

Expand Down
1 change: 1 addition & 0 deletions prover/server/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.7
3 changes: 2 additions & 1 deletion prover/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
"github.com/urfave/cli/v2"
)

const Version = "2.0.6"
//go:embed VERSION
var Version string

func main() {
runCli()
Expand Down
Loading