From 4307fc8e332965a2da934fd56a0e8d0aa70f0929 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 8 Apr 2026 12:22:42 +0530 Subject: [PATCH 1/6] Improved ghost frog test binary management --- .github/workflows/ghostFrogTests.yml | 51 ++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ghostFrogTests.yml b/.github/workflows/ghostFrogTests.yml index 4b03bfd6c..c5eb656b4 100644 --- a/.github/workflows/ghostFrogTests.yml +++ b/.github/workflows/ghostFrogTests.yml @@ -42,15 +42,60 @@ jobs: - name: Setup Go with cache uses: jfrog/.github/actions/install-go-with-cache@main + + # Build jf/jfrog from source and upload to remote Artifactory. + # setup-jfrog-cli with default version (latest) requests: + # {repo}/v2/[RELEASE]/jfrog-cli-{arch}/{filename} + # We upload to that exact path so the download URL matches. + - name: Build and publish JFrog CLI to Artifactory (Unix) + if: runner.os != 'Windows' + run: | + OS=$(go env GOOS) + ARCH=$(go env GOARCH) + if [ "$OS" = "darwin" ]; then + [ "$ARCH" = "arm64" ] && CLI_ARCH="mac-arm64" || CLI_ARCH="mac-386" + elif [ "$ARCH" = "arm64" ]; then + CLI_ARCH="linux-arm64" + elif [ "$ARCH" = "amd64" ]; then + CLI_ARCH="linux-amd64" + else + CLI_ARCH="linux-386" + fi + + REPO="ghost-frog-cli" + UPLOAD_PATH="${REPO}/v2/[RELEASE]/jfrog-cli-${CLI_ARCH}" + + go build -o jf . + cp jf jfrog + + ./jf c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false + ./jf rt repo-create "${REPO}" --repo-type=local --package-type=generic --server-id=ghost-rt 2>/dev/null || true + ./jf rt upload jf "${UPLOAD_PATH}/jf" --server-id=ghost-rt --flat + ./jf rt upload jfrog "${UPLOAD_PATH}/jfrog" --server-id=ghost-rt --flat + rm -f jf jfrog + + - name: Build and publish JFrog CLI to Artifactory (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + $REPO = "ghost-frog-cli" + $UPLOAD_PATH = "$REPO/v2/[RELEASE]/jfrog-cli-windows-amd64" + + go build -o jf.exe . + Copy-Item jf.exe jfrog.exe + + .\jf.exe c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false + .\jf.exe rt repo-create "$REPO" --repo-type=local --package-type=generic --server-id=ghost-rt 2>$null + .\jf.exe rt upload jf.exe "$UPLOAD_PATH/jf.exe" --server-id=ghost-rt --flat + .\jf.exe rt upload jfrog.exe "$UPLOAD_PATH/jfrog.exe" --server-id=ghost-rt --flat + Remove-Item jf.exe, jfrog.exe -ErrorAction SilentlyContinue - name: Setup JFrog CLI with package alias uses: jfrog/setup-jfrog-cli@package-alias with: - version: 2.93.0 - download-repository: bhanu-ghost-frog + download-repository: ghost-frog-cli enable-package-alias: true package-alias-tools: npm,mvn,go,pip - custom-server-id: ghost-demo env: JF_URL: ${{ secrets.JFROG_URL }} JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }} From dfdf62b9bb58bd9d5ee2dc0b3f1bef38081a7954 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 8 Apr 2026 12:29:00 +0530 Subject: [PATCH 2/6] Improved ghost frog test binary management --- .github/workflows/ghostFrogTests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ghostFrogTests.yml b/.github/workflows/ghostFrogTests.yml index c5eb656b4..1c14672e2 100644 --- a/.github/workflows/ghostFrogTests.yml +++ b/.github/workflows/ghostFrogTests.yml @@ -4,9 +4,8 @@ on: push: branches: - "master" - - "ghost-frog" # Triggers the workflow on PRs to master branch only. - pull_request_target: + pull_request: types: [labeled] branches: - "master" From 8c62aa98818dd675087c5ac46be407e2c7843959 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 8 Apr 2026 14:20:05 +0530 Subject: [PATCH 3/6] Updated to use cli version --- .github/workflows/ghostFrogTests.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ghostFrogTests.yml b/.github/workflows/ghostFrogTests.yml index 1c14672e2..3cd1f22b6 100644 --- a/.github/workflows/ghostFrogTests.yml +++ b/.github/workflows/ghostFrogTests.yml @@ -42,13 +42,18 @@ jobs: - name: Setup Go with cache uses: jfrog/.github/actions/install-go-with-cache@main - # Build jf/jfrog from source and upload to remote Artifactory. - # setup-jfrog-cli with default version (latest) requests: - # {repo}/v2/[RELEASE]/jfrog-cli-{arch}/{filename} - # We upload to that exact path so the download URL matches. + # Build jf/jfrog from source and upload to Artifactory local repo. + # [RELEASE] layout token only resolves on remote/virtual repos, so we + # extract the version from the built binary and upload to v2/{version}/... - name: Build and publish JFrog CLI to Artifactory (Unix) if: runner.os != 'Windows' run: | + go build -o jf . + cp jf jfrog + + VERSION=$(./jf --version | awk '{print $3}') + echo "CLI_VERSION=${VERSION}" >> $GITHUB_ENV + OS=$(go env GOOS) ARCH=$(go env GOARCH) if [ "$OS" = "darwin" ]; then @@ -62,10 +67,7 @@ jobs: fi REPO="ghost-frog-cli" - UPLOAD_PATH="${REPO}/v2/[RELEASE]/jfrog-cli-${CLI_ARCH}" - - go build -o jf . - cp jf jfrog + UPLOAD_PATH="${REPO}/v2/${VERSION}/jfrog-cli-${CLI_ARCH}" ./jf c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false ./jf rt repo-create "${REPO}" --repo-type=local --package-type=generic --server-id=ghost-rt 2>/dev/null || true @@ -77,12 +79,15 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | - $REPO = "ghost-frog-cli" - $UPLOAD_PATH = "$REPO/v2/[RELEASE]/jfrog-cli-windows-amd64" - go build -o jf.exe . Copy-Item jf.exe jfrog.exe + $VERSION = (.\jf.exe --version | Select-String -Pattern '\d+\.\d+\.\d+').Matches.Value + echo "CLI_VERSION=$VERSION" >> $env:GITHUB_ENV + + $REPO = "ghost-frog-cli" + $UPLOAD_PATH = "$REPO/v2/$VERSION/jfrog-cli-windows-amd64" + .\jf.exe c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false .\jf.exe rt repo-create "$REPO" --repo-type=local --package-type=generic --server-id=ghost-rt 2>$null .\jf.exe rt upload jf.exe "$UPLOAD_PATH/jf.exe" --server-id=ghost-rt --flat @@ -92,6 +97,7 @@ jobs: - name: Setup JFrog CLI with package alias uses: jfrog/setup-jfrog-cli@package-alias with: + version: ${{ env.CLI_VERSION }} download-repository: ghost-frog-cli enable-package-alias: true package-alias-tools: npm,mvn,go,pip From b68dd547c791800823ce0aaa401066658f881d92 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 8 Apr 2026 16:17:30 +0530 Subject: [PATCH 4/6] Updated to use repo-create command right --- .github/workflows/ghostFrogTests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ghostFrogTests.yml b/.github/workflows/ghostFrogTests.yml index 3cd1f22b6..b9644d40f 100644 --- a/.github/workflows/ghostFrogTests.yml +++ b/.github/workflows/ghostFrogTests.yml @@ -70,7 +70,8 @@ jobs: UPLOAD_PATH="${REPO}/v2/${VERSION}/jfrog-cli-${CLI_ARCH}" ./jf c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false - ./jf rt repo-create "${REPO}" --repo-type=local --package-type=generic --server-id=ghost-rt 2>/dev/null || true + echo "{\"key\": \"${REPO}\", \"rclass\": \"local\", \"packageType\": \"generic\"}" > /tmp/repo-template.json + ./jf rt repo-create /tmp/repo-template.json --server-id=ghost-rt 2>/dev/null || true ./jf rt upload jf "${UPLOAD_PATH}/jf" --server-id=ghost-rt --flat ./jf rt upload jfrog "${UPLOAD_PATH}/jfrog" --server-id=ghost-rt --flat rm -f jf jfrog @@ -89,7 +90,9 @@ jobs: $UPLOAD_PATH = "$REPO/v2/$VERSION/jfrog-cli-windows-amd64" .\jf.exe c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false - .\jf.exe rt repo-create "$REPO" --repo-type=local --package-type=generic --server-id=ghost-rt 2>$null + '{"key": "' + $REPO + '", "rclass": "local", "packageType": "generic"}' | Set-Content -Path "$env:TEMP\repo-template.json" + .\jf.exe rt repo-create "$env:TEMP\repo-template.json" --server-id=ghost-rt 2>$null + if ($LASTEXITCODE -ne 0) { Write-Host "repo-create failed or repo already exists, continuing..." } .\jf.exe rt upload jf.exe "$UPLOAD_PATH/jf.exe" --server-id=ghost-rt --flat .\jf.exe rt upload jfrog.exe "$UPLOAD_PATH/jfrog.exe" --server-id=ghost-rt --flat Remove-Item jf.exe, jfrog.exe -ErrorAction SilentlyContinue From 52af6f89891f88d2f24558be26d7cb7c8fba0ed0 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 8 Apr 2026 16:23:16 +0530 Subject: [PATCH 5/6] Updated secrets from platform secrets --- .github/workflows/ghostFrogTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ghostFrogTests.yml b/.github/workflows/ghostFrogTests.yml index b9644d40f..7f63aa6d8 100644 --- a/.github/workflows/ghostFrogTests.yml +++ b/.github/workflows/ghostFrogTests.yml @@ -105,8 +105,8 @@ jobs: enable-package-alias: true package-alias-tools: npm,mvn,go,pip env: - JF_URL: ${{ secrets.JFROG_URL }} - JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }} + JF_URL: ${{ secrets.PLATFORM_URL }} + JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v5 From f6a7bb9a093e58a02f2e632e2664ffdb78d302e4 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 8 Apr 2026 16:40:18 +0530 Subject: [PATCH 6/6] Skipped ghost frog tests --- .github/workflows/ghostFrogTests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ghostFrogTests.yml b/.github/workflows/ghostFrogTests.yml index 7f63aa6d8..b731b20f6 100644 --- a/.github/workflows/ghostFrogTests.yml +++ b/.github/workflows/ghostFrogTests.yml @@ -113,7 +113,8 @@ jobs: with: node-version: "16" - - name: Run Ghost Frog tests - run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.ghostFrog - env: - JFROG_CLI_LOG_LEVEL: DEBUG + # Ghost Frog tests will be enabled once the ghost-frog branch is merged. + # - name: Run Ghost Frog tests + # run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.ghostFrog + # env: + # JFROG_CLI_LOG_LEVEL: DEBUG