Skip to content

Commit 4307fc8

Browse files
committed
Improved ghost frog test binary management
1 parent 2233717 commit 4307fc8

1 file changed

Lines changed: 48 additions & 3 deletions

File tree

.github/workflows/ghostFrogTests.yml

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,60 @@ jobs:
4242

4343
- name: Setup Go with cache
4444
uses: jfrog/.github/actions/install-go-with-cache@main
45+
46+
# Build jf/jfrog from source and upload to remote Artifactory.
47+
# setup-jfrog-cli with default version (latest) requests:
48+
# {repo}/v2/[RELEASE]/jfrog-cli-{arch}/{filename}
49+
# We upload to that exact path so the download URL matches.
50+
- name: Build and publish JFrog CLI to Artifactory (Unix)
51+
if: runner.os != 'Windows'
52+
run: |
53+
OS=$(go env GOOS)
54+
ARCH=$(go env GOARCH)
55+
if [ "$OS" = "darwin" ]; then
56+
[ "$ARCH" = "arm64" ] && CLI_ARCH="mac-arm64" || CLI_ARCH="mac-386"
57+
elif [ "$ARCH" = "arm64" ]; then
58+
CLI_ARCH="linux-arm64"
59+
elif [ "$ARCH" = "amd64" ]; then
60+
CLI_ARCH="linux-amd64"
61+
else
62+
CLI_ARCH="linux-386"
63+
fi
64+
65+
REPO="ghost-frog-cli"
66+
UPLOAD_PATH="${REPO}/v2/[RELEASE]/jfrog-cli-${CLI_ARCH}"
67+
68+
go build -o jf .
69+
cp jf jfrog
70+
71+
./jf c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false
72+
./jf rt repo-create "${REPO}" --repo-type=local --package-type=generic --server-id=ghost-rt 2>/dev/null || true
73+
./jf rt upload jf "${UPLOAD_PATH}/jf" --server-id=ghost-rt --flat
74+
./jf rt upload jfrog "${UPLOAD_PATH}/jfrog" --server-id=ghost-rt --flat
75+
rm -f jf jfrog
76+
77+
- name: Build and publish JFrog CLI to Artifactory (Windows)
78+
if: runner.os == 'Windows'
79+
shell: pwsh
80+
run: |
81+
$REPO = "ghost-frog-cli"
82+
$UPLOAD_PATH = "$REPO/v2/[RELEASE]/jfrog-cli-windows-amd64"
83+
84+
go build -o jf.exe .
85+
Copy-Item jf.exe jfrog.exe
86+
87+
.\jf.exe c add ghost-rt --url=${{ secrets.PLATFORM_URL }} --access-token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --interactive=false
88+
.\jf.exe rt repo-create "$REPO" --repo-type=local --package-type=generic --server-id=ghost-rt 2>$null
89+
.\jf.exe rt upload jf.exe "$UPLOAD_PATH/jf.exe" --server-id=ghost-rt --flat
90+
.\jf.exe rt upload jfrog.exe "$UPLOAD_PATH/jfrog.exe" --server-id=ghost-rt --flat
91+
Remove-Item jf.exe, jfrog.exe -ErrorAction SilentlyContinue
4592
4693
- name: Setup JFrog CLI with package alias
4794
uses: jfrog/setup-jfrog-cli@package-alias
4895
with:
49-
version: 2.93.0
50-
download-repository: bhanu-ghost-frog
96+
download-repository: ghost-frog-cli
5197
enable-package-alias: true
5298
package-alias-tools: npm,mvn,go,pip
53-
custom-server-id: ghost-demo
5499
env:
55100
JF_URL: ${{ secrets.JFROG_URL }}
56101
JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)