From 8d0642115f6c3ee2762ececd3fc9157cee970d77 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 26 Jan 2026 14:39:17 +0100 Subject: [PATCH 1/7] added testing release --- .github/workflows/build-cli.yml | 55 +++++++++++++------ .github/workflows/release.yml | 96 +++++++++++++++++++++++++++------ 2 files changed, 118 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index e9d4206..491985b 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -49,25 +49,48 @@ jobs: echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT echo "Building version: ${VERSION}" - - name: Build scorex for Linux (x86_64) - run: VERSION=${{ steps.version.outputs.VERSION }} bazel build //scorex:scorex_linux_amd64 + - name: Build scorex for all platforms + run: | + VERSION=${{ steps.version.outputs.VERSION }} bazel build \ + //scorex:scorex_linux_amd64 \ + //scorex:scorex_darwin_arm64 \ + //scorex:scorex_windows_amd64 - - name: Copy Linux binary + - name: Copy binaries to artifacts run: | mkdir -p artifacts - cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 artifacts/scorex-linux-x86_64 - - - name: Build scorex for macOS (Apple Silicon) - run: VERSION=${{ steps.version.outputs.VERSION }} bazel build //scorex:scorex_darwin_arm64 - - - name: Copy macOS binary - run: cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 artifacts/scorex-macos-arm64 - - - name: Build scorex for Windows (x86_64) - run: VERSION=${{ steps.version.outputs.VERSION }} bazel build //scorex:scorex_windows_amd64 - - - name: Copy Windows binary - run: cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe artifacts/scorex-windows-x86_64.exe + + # Debug: Check bazel-bin structure + echo "Checking bazel-bin structure:" + ls -la bazel-bin/scorex/ || true + + # Copy Linux binary + if [ -f "bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64" ]; then + cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 artifacts/scorex-linux-x86_64 + echo "✓ Linux binary copied" + else + echo "ERROR: Linux binary not found" + find bazel-bin -name "scorex_linux_amd64" -type f + exit 1 + fi + + # Copy macOS ARM64 binary + if [ -f "bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64" ]; then + cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 artifacts/scorex-macos-arm64 + echo "✓ macOS ARM64 binary copied" + else + echo "ERROR: macOS ARM64 binary not found" + exit 1 + fi + + # Copy Windows binary + if [ -f "bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe" ]; then + cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe artifacts/scorex-windows-x86_64.exe + echo "✓ Windows binary copied" + else + echo "ERROR: Windows binary not found" + exit 1 + fi - name: Upload CLI artifacts uses: actions/upload-artifact@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 356d1ce..f977ca1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,17 @@ on: push: tags: - 'v*' + workflow_dispatch: + inputs: + version: + description: 'Version to use for test release (e.g., 0.1.0-test)' + required: false + default: '0.0.0-test' + pull_request: + types: [opened, reopened, synchronize] + paths: + - 'scorex/**' + - '.github/workflows/release.yml' jobs: build-and-release: @@ -39,30 +50,70 @@ jobs: - name: Get version from tag id: version run: | - VERSION=${GITHUB_REF#refs/tags/v} + if [ "${{ github.event_name }}" == "push" ] && [ -n "${{ github.ref }}" ]; then + # Release from tag + VERSION=${GITHUB_REF#refs/tags/v} + TAG=${GITHUB_REF#refs/tags/} + elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + # Manual test release + VERSION="${{ github.event.inputs.version }}" + TAG="test-${VERSION}" + else + # PR test release + SHORT_SHA=$(git rev-parse --short HEAD) + VERSION="pr-${{ github.event.pull_request.number }}-${SHORT_SHA}" + TAG="test-${VERSION}" + fi echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + echo "TAG=${TAG}" >> $GITHUB_OUTPUT echo "Building version: ${VERSION}" - - name: Build scorex for Linux (x86_64) - run: VERSION=${{ steps.version.outputs.VERSION }} bazel build //scorex:scorex_linux_amd64 - - - name: Build scorex for macOS (Apple Silicon) - run: VERSION=${{ steps.version.outputs.VERSION }} bazel build //scorex:scorex_darwin_arm64 - - - name: Build scorex for macOS (Intel) - run: VERSION=${{ steps.version.outputs.VERSION }} bazel build //scorex:scorex_darwin_amd64 - - - name: Build scorex for Windows (x86_64) - run: VERSION=${{ steps.version.outputs.VERSION }} bazel build //scorex:scorex_windows_amd64 + - name: Build scorex for all platforms + run: | + VERSION=${{ steps.version.outputs.VERSION }} bazel build \ + //scorex:scorex_linux_amd64 \ + //scorex:scorex_darwin_arm64 \ + //scorex:scorex_darwin_amd64 \ + //scorex:scorex_windows_amd64 - name: Prepare release artifacts run: | mkdir -p release - cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 release/scorex-linux-x86_64 - cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 release/scorex-macos-arm64 - cp bazel-bin/scorex/scorex_darwin_amd64_/scorex_darwin_amd64 release/scorex-macos-x86_64 - cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe release/scorex-windows-x86_64.exe + # Debug: Check bazel-bin structure + echo "Checking bazel-bin structure:" + ls -la bazel-bin/scorex/ || true + echo "Checking for Linux binary:" + ls -la bazel-bin/scorex/scorex_linux_amd64_/ || true + + # Copy binaries with error checking + if [ -f "bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64" ]; then + cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 release/scorex-linux-x86_64 + else + echo "ERROR: Linux binary not found at expected location" + find bazel-bin -name "scorex_linux_amd64" -type f + exit 1 + fi + + if [ -f "bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64" ]; then + cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 release/scorex-macos-arm64 + else + echo "ERROR: macOS ARM64 binary not found" + exit 1 + fi + + if [ -f "bazel-bin/scorex/scorex_darwin_amd64_/scorex_darwin_amd64" ]; then + cp bazel-bin/scorex/scorex_darwin_amd64_/scorex_darwin_amd64 release/scorex-macos-x86_64 + else + echo "ERROR: macOS AMD64 binary not found" + exit 1 + fi + + if [ -f "bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe" ]; then + cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe release/scorex-windows-x86_64.exe + else + echo "ERROR: Windows binary not found" + exit 1 + fi # Create compressed archives cd release @@ -75,6 +126,8 @@ jobs: sha256sum *.tar.gz *.zip > checksums.txt - name: Create Release + # Only create actual release on tag push + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: files: | @@ -86,3 +139,12 @@ jobs: generate_release_notes: true draft: false prerelease: false + + - name: Upload test artifacts + # Upload artifacts for PRs and manual runs + if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 + with: + name: scorex-test-binaries-${{ steps.version.outputs.VERSION }} + path: release/* + retention-days: 7 From 4e5fb09b4e3b623377f8d04431a6b3c8c451c3dc Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 26 Jan 2026 14:39:54 +0100 Subject: [PATCH 2/7] fix release --- .github/workflows/build-cli.yml | 8 ++++---- .github/workflows/release.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 491985b..c010288 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -59,11 +59,11 @@ jobs: - name: Copy binaries to artifacts run: | mkdir -p artifacts - + # Debug: Check bazel-bin structure echo "Checking bazel-bin structure:" ls -la bazel-bin/scorex/ || true - + # Copy Linux binary if [ -f "bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64" ]; then cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 artifacts/scorex-linux-x86_64 @@ -73,7 +73,7 @@ jobs: find bazel-bin -name "scorex_linux_amd64" -type f exit 1 fi - + # Copy macOS ARM64 binary if [ -f "bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64" ]; then cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 artifacts/scorex-macos-arm64 @@ -82,7 +82,7 @@ jobs: echo "ERROR: macOS ARM64 binary not found" exit 1 fi - + # Copy Windows binary if [ -f "bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe" ]; then cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe artifacts/scorex-windows-x86_64.exe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f977ca1..e735c81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: ls -la bazel-bin/scorex/ || true echo "Checking for Linux binary:" ls -la bazel-bin/scorex/scorex_linux_amd64_/ || true - + # Copy binaries with error checking if [ -f "bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64" ]; then cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 release/scorex-linux-x86_64 @@ -93,21 +93,21 @@ jobs: find bazel-bin -name "scorex_linux_amd64" -type f exit 1 fi - + if [ -f "bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64" ]; then cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 release/scorex-macos-arm64 else echo "ERROR: macOS ARM64 binary not found" exit 1 fi - + if [ -f "bazel-bin/scorex/scorex_darwin_amd64_/scorex_darwin_amd64" ]; then cp bazel-bin/scorex/scorex_darwin_amd64_/scorex_darwin_amd64 release/scorex-macos-x86_64 else echo "ERROR: macOS AMD64 binary not found" exit 1 fi - + if [ -f "bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe" ]; then cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe release/scorex-windows-x86_64.exe else From c32d017247a047ce343b38f568181ca8db83a944 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 26 Jan 2026 14:48:33 +0100 Subject: [PATCH 3/7] tryout bazel cquery --- .github/workflows/build-cli.yml | 35 ++++++++++--------- .github/workflows/release.yml | 60 +++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index c010288..f824df9 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -59,33 +59,36 @@ jobs: - name: Copy binaries to artifacts run: | mkdir -p artifacts - - # Debug: Check bazel-bin structure - echo "Checking bazel-bin structure:" - ls -la bazel-bin/scorex/ || true - - # Copy Linux binary - if [ -f "bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64" ]; then - cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 artifacts/scorex-linux-x86_64 + + # Use bazel cquery to find actual output paths (bazel-bin symlink is cleared for multi-platform builds) + echo "Finding binary locations..." + LINUX_BIN=$(bazel cquery --output=files //scorex:scorex_linux_amd64 2>/dev/null) + DARWIN_ARM64_BIN=$(bazel cquery --output=files //scorex:scorex_darwin_arm64 2>/dev/null) + WINDOWS_BIN=$(bazel cquery --output=files //scorex:scorex_windows_amd64 2>/dev/null) + + echo "Linux binary: $LINUX_BIN" + echo "macOS ARM64 binary: $DARWIN_ARM64_BIN" + echo "Windows binary: $WINDOWS_BIN" + + # Copy binaries + if [ -f "$LINUX_BIN" ]; then + cp "$LINUX_BIN" artifacts/scorex-linux-x86_64 echo "✓ Linux binary copied" else - echo "ERROR: Linux binary not found" - find bazel-bin -name "scorex_linux_amd64" -type f + echo "ERROR: Linux binary not found at $LINUX_BIN" exit 1 fi - # Copy macOS ARM64 binary - if [ -f "bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64" ]; then - cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 artifacts/scorex-macos-arm64 + if [ -f "$DARWIN_ARM64_BIN" ]; then + cp "$DARWIN_ARM64_BIN" artifacts/scorex-macos-arm64 echo "✓ macOS ARM64 binary copied" else echo "ERROR: macOS ARM64 binary not found" exit 1 fi - # Copy Windows binary - if [ -f "bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe" ]; then - cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe artifacts/scorex-windows-x86_64.exe + if [ -f "$WINDOWS_BIN" ]; then + cp "$WINDOWS_BIN" artifacts/scorex-windows-x86_64.exe echo "✓ Windows binary copied" else echo "ERROR: Windows binary not found" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e735c81..1d922fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,46 +70,72 @@ jobs: - name: Build scorex for all platforms run: | + echo "Current directory: $(pwd)" + echo "Building all platforms..." VERSION=${{ steps.version.outputs.VERSION }} bazel build \ //scorex:scorex_linux_amd64 \ //scorex:scorex_darwin_arm64 \ //scorex:scorex_darwin_amd64 \ //scorex:scorex_windows_amd64 + echo "Build complete. Exit code: $?" + + - name: Debug bazel output + run: | + echo "=== Current directory ===" + pwd + echo "=== Listing current directory ===" + ls -la + echo "=== Checking for bazel-bin symlink ===" + ls -la | grep bazel || echo "No bazel symlinks found" + echo "=== Searching for bazel output ===" + find . -type d -name "bazel-bin" 2>/dev/null || echo "bazel-bin directory not found" + echo "=== Searching for scorex binaries ===" + find . -name "scorex_linux_amd64" -type f 2>/dev/null || echo "No Linux binary found" - name: Prepare release artifacts run: | mkdir -p release - # Debug: Check bazel-bin structure - echo "Checking bazel-bin structure:" - ls -la bazel-bin/scorex/ || true - echo "Checking for Linux binary:" - ls -la bazel-bin/scorex/scorex_linux_amd64_/ || true - - # Copy binaries with error checking - if [ -f "bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64" ]; then - cp bazel-bin/scorex/scorex_linux_amd64_/scorex_linux_amd64 release/scorex-linux-x86_64 + + # Use bazel cquery to find actual output paths (bazel-bin symlink is cleared for multi-platform builds) + echo "Finding binary locations..." + LINUX_BIN=$(bazel cquery --output=files //scorex:scorex_linux_amd64 2>/dev/null) + DARWIN_ARM64_BIN=$(bazel cquery --output=files //scorex:scorex_darwin_arm64 2>/dev/null) + DARWIN_AMD64_BIN=$(bazel cquery --output=files //scorex:scorex_darwin_amd64 2>/dev/null) + WINDOWS_BIN=$(bazel cquery --output=files //scorex:scorex_windows_amd64 2>/dev/null) + + echo "Linux binary: $LINUX_BIN" + echo "macOS ARM64 binary: $DARWIN_ARM64_BIN" + echo "macOS AMD64 binary: $DARWIN_AMD64_BIN" + echo "Windows binary: $WINDOWS_BIN" + + # Copy binaries + if [ -f "$LINUX_BIN" ]; then + cp "$LINUX_BIN" release/scorex-linux-x86_64 + echo "✓ Linux binary copied" else - echo "ERROR: Linux binary not found at expected location" - find bazel-bin -name "scorex_linux_amd64" -type f + echo "ERROR: Linux binary not found at $LINUX_BIN" exit 1 fi - if [ -f "bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64" ]; then - cp bazel-bin/scorex/scorex_darwin_arm64_/scorex_darwin_arm64 release/scorex-macos-arm64 + if [ -f "$DARWIN_ARM64_BIN" ]; then + cp "$DARWIN_ARM64_BIN" release/scorex-macos-arm64 + echo "✓ macOS ARM64 binary copied" else echo "ERROR: macOS ARM64 binary not found" exit 1 fi - if [ -f "bazel-bin/scorex/scorex_darwin_amd64_/scorex_darwin_amd64" ]; then - cp bazel-bin/scorex/scorex_darwin_amd64_/scorex_darwin_amd64 release/scorex-macos-x86_64 + if [ -f "$DARWIN_AMD64_BIN" ]; then + cp "$DARWIN_AMD64_BIN" release/scorex-macos-x86_64 + echo "✓ macOS AMD64 binary copied" else echo "ERROR: macOS AMD64 binary not found" exit 1 fi - if [ -f "bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe" ]; then - cp bazel-bin/scorex/scorex_windows_amd64_/scorex_windows_amd64.exe release/scorex-windows-x86_64.exe + if [ -f "$WINDOWS_BIN" ]; then + cp "$WINDOWS_BIN" release/scorex-windows-x86_64.exe + echo "✓ Windows binary copied" else echo "ERROR: Windows binary not found" exit 1 From 6ef81193eef8894dba76cffc8f3e75eeb2da7d96 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 26 Jan 2026 14:48:49 +0100 Subject: [PATCH 4/7] try bazel cquery --- .github/workflows/build-cli.yml | 6 +++--- .github/workflows/release.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index f824df9..0cce17b 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -59,17 +59,17 @@ jobs: - name: Copy binaries to artifacts run: | mkdir -p artifacts - + # Use bazel cquery to find actual output paths (bazel-bin symlink is cleared for multi-platform builds) echo "Finding binary locations..." LINUX_BIN=$(bazel cquery --output=files //scorex:scorex_linux_amd64 2>/dev/null) DARWIN_ARM64_BIN=$(bazel cquery --output=files //scorex:scorex_darwin_arm64 2>/dev/null) WINDOWS_BIN=$(bazel cquery --output=files //scorex:scorex_windows_amd64 2>/dev/null) - + echo "Linux binary: $LINUX_BIN" echo "macOS ARM64 binary: $DARWIN_ARM64_BIN" echo "Windows binary: $WINDOWS_BIN" - + # Copy binaries if [ -f "$LINUX_BIN" ]; then cp "$LINUX_BIN" artifacts/scorex-linux-x86_64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d922fd..63c1f4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,19 +95,19 @@ jobs: - name: Prepare release artifacts run: | mkdir -p release - + # Use bazel cquery to find actual output paths (bazel-bin symlink is cleared for multi-platform builds) echo "Finding binary locations..." LINUX_BIN=$(bazel cquery --output=files //scorex:scorex_linux_amd64 2>/dev/null) DARWIN_ARM64_BIN=$(bazel cquery --output=files //scorex:scorex_darwin_arm64 2>/dev/null) DARWIN_AMD64_BIN=$(bazel cquery --output=files //scorex:scorex_darwin_amd64 2>/dev/null) WINDOWS_BIN=$(bazel cquery --output=files //scorex:scorex_windows_amd64 2>/dev/null) - + echo "Linux binary: $LINUX_BIN" echo "macOS ARM64 binary: $DARWIN_ARM64_BIN" echo "macOS AMD64 binary: $DARWIN_AMD64_BIN" echo "Windows binary: $WINDOWS_BIN" - + # Copy binaries if [ -f "$LINUX_BIN" ]; then cp "$LINUX_BIN" release/scorex-linux-x86_64 From 7f6a6f03d2a8e64c25efb58ad95b469ec730b2e1 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 26 Jan 2026 15:37:59 +0100 Subject: [PATCH 5/7] optimized artifacts and distribution --- .github/workflows/build-cli.yml | 20 ++++- .github/workflows/release.yml | 24 +++++- scorex/README.md | 142 ++++++++++++++++---------------- 3 files changed, 110 insertions(+), 76 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 0cce17b..da20824 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -95,9 +95,23 @@ jobs: exit 1 fi - - name: Upload CLI artifacts + - name: Upload Linux artifacts uses: actions/upload-artifact@v4 with: - name: scorex-cli-${{ steps.version.outputs.VERSION }} - path: artifacts/ + name: scorex-linux + path: artifacts/scorex-linux-x86_64 + if-no-files-found: error + + - name: Upload macOS artifacts + uses: actions/upload-artifact@v4 + with: + name: scorex-macos + path: artifacts/scorex-macos-arm64 + if-no-files-found: error + + - name: Upload Windows artifacts + uses: actions/upload-artifact@v4 + with: + name: scorex-windows + path: artifacts/scorex-windows-x86_64.exe if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63c1f4f..db00a05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -166,11 +166,29 @@ jobs: draft: false prerelease: false - - name: Upload test artifacts + - name: Upload Linux artifacts # Upload artifacts for PRs and manual runs if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v4 with: - name: scorex-test-binaries-${{ steps.version.outputs.VERSION }} - path: release/* + name: scorex-linux + path: release/scorex-${{ steps.version.outputs.VERSION }}-linux-x86_64.tar.gz + retention-days: 7 + + - name: Upload macOS artifacts + if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 + with: + name: scorex-macos + path: | + release/scorex-${{ steps.version.outputs.VERSION }}-macos-arm64.tar.gz + release/scorex-${{ steps.version.outputs.VERSION }}-macos-x86_64.tar.gz + retention-days: 7 + + - name: Upload Windows artifacts + if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 + with: + name: scorex-windows + path: release/scorex-${{ steps.version.outputs.VERSION }}-windows-x86_64.zip retention-days: 7 diff --git a/scorex/README.md b/scorex/README.md index 6918902..f67df58 100644 --- a/scorex/README.md +++ b/scorex/README.md @@ -80,99 +80,101 @@ The `init` command (see [scorex/cmd/init.go](scorex/cmd/init.go)) supports: ## Distribution -The `scorex` CLI is distributed through multiple package managers for easy installation across different platforms. +The `scorex` CLI can be distributed through multiple methods. -### Installation Methods +### Current Installation Methods -#### macOS & Linux - Homebrew - -```bash -# Add the tap (once a tap repository is created) -brew tap eclipse-score/tap +#### Manual Download (Available Now) -# Install scorex -brew install scorex -``` +Download the appropriate binary for your platform from the [releases page](https://github.com/eclipse-score/score_scrample/releases): -#### Windows - Scoop +- **Linux (x86_64)**: `scorex-VERSION-linux-x86_64.tar.gz` +- **macOS (Apple Silicon)**: `scorex-VERSION-macos-arm64.tar.gz` +- **macOS (Intel)**: `scorex-VERSION-macos-x86_64.tar.gz` +- **Windows (x86_64)**: `scorex-VERSION-windows-x86_64.zip` -```bash -# Add the bucket (once a bucket repository is created) -scoop bucket add eclipse-score https://github.com/eclipse-score/scoop-bucket +**Installation steps:** -# Install scorex -scoop install scorex -``` +1. Download the appropriate archive for your platform +2. Extract it: + ```bash + # macOS/Linux + tar -xzf scorex-VERSION-platform.tar.gz + + # Windows (PowerShell) + Expand-Archive scorex-VERSION-windows-x86_64.zip + ``` +3. Move the binary to a directory in your PATH: + ```bash + # macOS/Linux + sudo mv scorex-platform /usr/local/bin/scorex + sudo chmod +x /usr/local/bin/scorex + + # Windows - move to a directory in your PATH or add the directory to PATH + ``` +4. Verify installation: + ```bash + scorex version + ``` -#### Universal - Install Script +#### Universal Install Script (Available Now) **macOS & Linux:** ```bash curl -sSL https://raw.githubusercontent.com/eclipse-score/score_scrample/main/scorex/distribution/install.sh | sh ``` -#### Manual Download +This script automatically: +- Detects your OS and architecture +- Downloads the correct binary +- Installs it to `/usr/local/bin/scorex` +- Makes it executable -Download the appropriate binary for your platform from the [releases page](https://github.com/eclipse-score/score_scrample/releases): +### Package Manager Installation -- **Linux (x86_64)**: `scorex-VERSION-linux-x86_64.tar.gz` -- **macOS (Apple Silicon)**: `scorex-VERSION-macos-arm64.tar.gz` -- **macOS (Intel)**: `scorex-VERSION-macos-x86_64.tar.gz` -- **Windows (x86_64)**: `scorex-VERSION-windows-x86_64.zip` +#### macOS & Linux - Homebrew + +```bash +# Install directly from this repository (no tap required) +brew install https://raw.githubusercontent.com/eclipse-score/score_scrample/main/scorex/distribution/homebrew/scorex.rb +``` + +**Note**: The formula checksums need to be updated manually after each release. See the maintainer section below. + +#### Windows - Scoop + +```bash +# Install directly from this repository (no bucket required) +scoop install https://raw.githubusercontent.com/eclipse-score/score_scrample/main/scorex/distribution/scoop/scorex.json +``` -Extract and move to a directory in your PATH. +**Note**: The manifest checksums need to be updated manually after each release. See the maintainer section below. ### For Maintainers #### Publishing a New Release -1. Create and push a new version tag: +1. **Create and push a version tag:** ```bash git tag v1.0.0 git push origin v1.0.0 ``` -2. GitHub Actions will automatically: - - Build binaries for all platforms - - Create compressed archives - - Generate checksums - - Create a GitHub release - -3. Update package manifests: - - **Homebrew Formula** (`distribution/homebrew/scorex.rb`): - - Update version number - - Update SHA256 checksums from `checksums.txt` in the release - - **Scoop Manifest** (`distribution/scoop/scorex.json`): - - Update version number - - Update SHA256 hash from `checksums.txt` - -4. Commit and push updated manifests to respective repositories: - - Homebrew: Create/update tap repository at `eclipse-score/homebrew-tap` - - Scoop: Create/update bucket repository at `eclipse-score/scoop-bucket` - -#### Setting Up Package Repositories - -**Homebrew Tap:** -1. Create repository: `https://github.com/eclipse-score/homebrew-tap` -2. Add `distribution/homebrew/scorex.rb` to the repository root or `Formula/` directory -3. Users can then install with: `brew install eclipse-score/tap/scorex` - -**Scoop Bucket:** -1. Create repository: `https://github.com/eclipse-score/scoop-bucket` -2. Add `distribution/scoop/scorex.json` to the `bucket/` directory -3. Users can then install with: `scoop bucket add eclipse-score ` then `scoop install scorex` - -#### Updating Checksums - -After each release, download `checksums.txt` from the GitHub release and update: - -```bash -# Example for version 1.0.0 -curl -sL https://github.com/eclipse-score/score_scrample/releases/download/v1.0.0/checksums.txt - -# Update the SHA256 values in: -# - distribution/homebrew/scorex.rb -# - distribution/scoop/scorex.json -``` +2. **GitHub Actions automatically:** + - Builds binaries for all platforms (Linux x86_64, macOS ARM64, macOS Intel, Windows x86_64) + - Creates compressed archives (.tar.gz for Unix, .zip for Windows) + - Generates `checksums.txt` with SHA256 hashes + - Creates a GitHub release with separate artifacts per platform + - Uploads artifacts: `scorex-linux`, `scorex-macos`, `scorex-windows` + +3. **Update package manager manifests:** + - Download `checksums.txt` from the GitHub release + - Update `distribution/homebrew/scorex.rb`: + - Set `version` to the new version (without the `v` prefix) + - Update the three `sha256` values (Linux, macOS ARM64, macOS Intel) from checksums.txt + - Update `distribution/scoop/scorex.json`: + - Set `version` to the new version (without the `v` prefix) + - Update the `hash` value for Windows from checksums.txt + - Commit and push these changes to the main repository + +4. **Users can now install** via direct URLs, install script, or manual download From b054ef1b8f4104658274b5da866885c455558eee Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 26 Jan 2026 15:38:24 +0100 Subject: [PATCH 6/7] Optimized readme --- scorex/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scorex/README.md b/scorex/README.md index f67df58..f642881 100644 --- a/scorex/README.md +++ b/scorex/README.md @@ -100,7 +100,7 @@ Download the appropriate binary for your platform from the [releases page](https ```bash # macOS/Linux tar -xzf scorex-VERSION-platform.tar.gz - + # Windows (PowerShell) Expand-Archive scorex-VERSION-windows-x86_64.zip ``` @@ -109,7 +109,7 @@ Download the appropriate binary for your platform from the [releases page](https # macOS/Linux sudo mv scorex-platform /usr/local/bin/scorex sudo chmod +x /usr/local/bin/scorex - + # Windows - move to a directory in your PATH or add the directory to PATH ``` 4. Verify installation: From 7afe2baddb856e0415171f7de11d255c5a40a506 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Fri, 30 Jan 2026 15:56:52 +0000 Subject: [PATCH 7/7] removed homebrew and scoop --- scorex/README.md | 111 +++++++++++++++---------- scorex/distribution/homebrew/scorex.rb | 39 --------- scorex/distribution/install.sh | 19 ++++- scorex/distribution/scoop/scorex.json | 23 ----- 4 files changed, 83 insertions(+), 109 deletions(-) delete mode 100644 scorex/distribution/homebrew/scorex.rb delete mode 100644 scorex/distribution/scoop/scorex.json diff --git a/scorex/README.md b/scorex/README.md index f642881..e547964 100644 --- a/scorex/README.md +++ b/scorex/README.md @@ -80,11 +80,32 @@ The `init` command (see [scorex/cmd/init.go](scorex/cmd/init.go)) supports: ## Distribution -The `scorex` CLI can be distributed through multiple methods. +### Installation Methods -### Current Installation Methods +#### Install Script (Recommended) -#### Manual Download (Available Now) +**macOS & Linux:** +```bash +curl -sSL https://raw.githubusercontent.com/eclipse-score/score_scrample/main/scorex/distribution/install.sh | sh +``` + +**Note**: Requires a published release. If no releases exist yet, use manual installation below. + +This script automatically: +- Detects your OS and architecture +- Downloads the correct binary from the latest release +- Installs it to `$HOME/.local/bin/scorex` (customizable via `SCOREX_INSTALL_DIR`) +- Makes it executable +- Removes macOS quarantine attribute automatically + +**Add to PATH** (if not already): +```bash +export PATH="$HOME/.local/bin:$PATH" +``` + +Add this to your `~/.zshrc` or `~/.bashrc` to make it permanent. + +#### Manual Download Download the appropriate binary for your platform from the [releases page](https://github.com/eclipse-score/score_scrample/releases): @@ -112,45 +133,53 @@ Download the appropriate binary for your platform from the [releases page](https # Windows - move to a directory in your PATH or add the directory to PATH ``` -4. Verify installation: +4. **macOS only**: Remove the quarantine attribute (required for unsigned binaries): ```bash - scorex version + sudo xattr -d com.apple.quarantine /usr/local/bin/scorex ``` + + Alternatively, on first run, right-click the binary in Finder and select "Open" to bypass Gatekeeper. -#### Universal Install Script (Available Now) - -**macOS & Linux:** -```bash -curl -sSL https://raw.githubusercontent.com/eclipse-score/score_scrample/main/scorex/distribution/install.sh | sh -``` - -This script automatically: -- Detects your OS and architecture -- Downloads the correct binary -- Installs it to `/usr/local/bin/scorex` -- Makes it executable - -### Package Manager Installation +5. Verify installation: + ```bash + scorex version + ``` -#### macOS & Linux - Homebrew +**Note for macOS users**: The binaries are currently unsigned. You may see a security warning. Use the `xattr` command above or right-click > Open to bypass Gatekeeper. -```bash -# Install directly from this repository (no tap required) -brew install https://raw.githubusercontent.com/eclipse-score/score_scrample/main/scorex/distribution/homebrew/scorex.rb -``` +### For Maintainers -**Note**: The formula checksums need to be updated manually after each release. See the maintainer section below. +#### Testing the Release Flow in PRs -#### Windows - Scoop +The release workflow runs on PRs and creates artifacts. To test the binaries: -```bash -# Install directly from this repository (no bucket required) -scoop install https://raw.githubusercontent.com/eclipse-score/score_scrample/main/scorex/distribution/scoop/scorex.json -``` +1. **Go to the PR's Actions tab** and find the latest "Release scorex CLI" workflow run +2. **Download the artifact** for your platform: + - `scorex-linux` - Contains Linux binary + - `scorex-macos` - Contains macOS binaries (ARM64 + Intel) + - `scorex-windows` - Contains Windows binary -**Note**: The manifest checksums need to be updated manually after each release. See the maintainer section below. +3. **Extract and test locally**: + ```bash + # Download artifact from GitHub Actions UI + unzip scorex-macos.zip + + # Extract the tar.gz + tar -xzf scorex-pr-*-macos-arm64.tar.gz + + # Make executable and remove quarantine (macOS) + chmod +x scorex-macos-arm64 + xattr -d com.apple.quarantine scorex-macos-arm64 2>/dev/null || true + + # Test it + ./scorex-macos-arm64 --help + ./scorex-macos-arm64 version + + # Test creating a project + ./scorex-macos-arm64 init --name test_app --dir /tmp/test_scorex + ``` -### For Maintainers +**Note**: The install script cannot be tested in PRs since it requires a published GitHub release. #### Publishing a New Release @@ -164,17 +193,7 @@ scoop install https://raw.githubusercontent.com/eclipse-score/score_scrample/mai - Builds binaries for all platforms (Linux x86_64, macOS ARM64, macOS Intel, Windows x86_64) - Creates compressed archives (.tar.gz for Unix, .zip for Windows) - Generates `checksums.txt` with SHA256 hashes - - Creates a GitHub release with separate artifacts per platform - - Uploads artifacts: `scorex-linux`, `scorex-macos`, `scorex-windows` - -3. **Update package manager manifests:** - - Download `checksums.txt` from the GitHub release - - Update `distribution/homebrew/scorex.rb`: - - Set `version` to the new version (without the `v` prefix) - - Update the three `sha256` values (Linux, macOS ARM64, macOS Intel) from checksums.txt - - Update `distribution/scoop/scorex.json`: - - Set `version` to the new version (without the `v` prefix) - - Update the `hash` value for Windows from checksums.txt - - Commit and push these changes to the main repository - -4. **Users can now install** via direct URLs, install script, or manual download + - Creates a GitHub release with all artifacts + - For PRs and manual runs: Uploads separate artifacts per platform (`scorex-linux`, `scorex-macos`, `scorex-windows`) + +3. **Users can install** via the install script or manual download from the releases page diff --git a/scorex/distribution/homebrew/scorex.rb b/scorex/distribution/homebrew/scorex.rb deleted file mode 100644 index 8cc6d54..0000000 --- a/scorex/distribution/homebrew/scorex.rb +++ /dev/null @@ -1,39 +0,0 @@ -class Scorex < Formula - desc "CLI for creating S-CORE skeleton projects" - homepage "https://github.com/eclipse-score/score_scrample" - version "0.1.0" - license "Apache-2.0" - - on_macos do - if Hardware::CPU.arm? - url "https://github.com/eclipse-score/score_scrample/releases/download/v#{version}/scorex-#{version}-macos-arm64.tar.gz" - sha256 "REPLACE_WITH_ACTUAL_SHA256_ARM64" - else - url "https://github.com/eclipse-score/score_scrample/releases/download/v#{version}/scorex-#{version}-macos-x86_64.tar.gz" - sha256 "REPLACE_WITH_ACTUAL_SHA256_X86_64" - end - end - - on_linux do - if Hardware::CPU.intel? - url "https://github.com/eclipse-score/score_scrample/releases/download/v#{version}/scorex-#{version}-linux-x86_64.tar.gz" - sha256 "REPLACE_WITH_ACTUAL_SHA256_LINUX" - end - end - - def install - if OS.mac? - if Hardware::CPU.arm? - bin.install "scorex-macos-arm64" => "scorex" - else - bin.install "scorex-macos-x86_64" => "scorex" - end - elsif OS.linux? - bin.install "scorex-linux-x86_64" => "scorex" - end - end - - test do - system "#{bin}/scorex", "version" - end -end diff --git a/scorex/distribution/install.sh b/scorex/distribution/install.sh index f941b60..28b1418 100755 --- a/scorex/distribution/install.sh +++ b/scorex/distribution/install.sh @@ -51,7 +51,18 @@ detect_platform() { get_latest_version() { VERSION=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/') if [ -z "$VERSION" ]; then - echo "Error: Could not fetch latest version" + echo "" + echo "Error: No releases found for scorex" + echo "" + echo "To use this installer, a release must be published first." + echo "Maintainers: Create a release by pushing a version tag:" + echo " git tag v0.1.0" + echo " git push origin v0.1.0" + echo "" + echo "For now, you can build from source:" + echo " cd scorex" + echo " go build -o scorex ." + echo "" exit 1 fi echo "Latest version: $VERSION" @@ -86,6 +97,12 @@ install_scorex() { mv "$BINARY" "$INSTALL_DIR/scorex" chmod +x "$INSTALL_DIR/scorex" + # Remove quarantine attribute on macOS + if [ "$OS" = "Darwin" ]; then + echo "Removing macOS quarantine attribute..." + xattr -d com.apple.quarantine "$INSTALL_DIR/scorex" 2>/dev/null || true + fi + rm -rf "$TEMP_DIR" echo "" diff --git a/scorex/distribution/scoop/scorex.json b/scorex/distribution/scoop/scorex.json deleted file mode 100644 index d677207..0000000 --- a/scorex/distribution/scoop/scorex.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "0.1.0", - "description": "CLI for creating S-CORE skeleton projects", - "homepage": "https://github.com/eclipse-score/score_scrample", - "license": "Apache-2.0", - "architecture": { - "64bit": { - "url": "https://github.com/eclipse-score/score_scrample/releases/download/v0.1.0/scorex-0.1.0-windows-x86_64.zip", - "hash": "REPLACE_WITH_ACTUAL_SHA256", - "bin": "scorex-windows-x86_64.exe" - } - }, - "checkver": { - "github": "https://github.com/eclipse-score/score_scrample" - }, - "autoupdate": { - "architecture": { - "64bit": { - "url": "https://github.com/eclipse-score/score_scrample/releases/download/v$version/scorex-$version-windows-x86_64.zip" - } - } - } -}