diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index d75200837..3f2094861 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -24,7 +24,24 @@ jobs: - run: npm ci - run: npm run build - - name: Check if pre-release and publish to NPM + - name: Build git-proxy-cli workspace + run: npm run build -w packages/git-proxy-cli + + - name: Verify git-proxy-cli is in lockstep with the root package + run: | + ROOT_VERSION=$(node -p "require('./package.json').version") + CLI_VERSION=$(node -p "require('./packages/git-proxy-cli/package.json').version") + CLI_PIN=$(node -p "require('./packages/git-proxy-cli/package.json').dependencies['@finos/git-proxy']") + if [[ "$CLI_VERSION" != "$ROOT_VERSION" ]]; then + echo "Version mismatch: root=$ROOT_VERSION cli=$CLI_VERSION" + exit 1 + fi + if [[ "$CLI_PIN" != "$ROOT_VERSION" ]]; then + echo "CLI pins @finos/git-proxy@$CLI_PIN but root is $ROOT_VERSION" + exit 1 + fi + + - name: Check if pre-release and publish @finos/git-proxy to NPM run: | VERSION=$(node -p "require('./package.json').version") if [[ "$VERSION" == *"-"* ]]; then @@ -34,3 +51,14 @@ jobs: echo "Publishing stable release: $VERSION" npm publish --access=public fi + + - name: Check if pre-release and publish @finos/git-proxy-cli to NPM + run: | + VERSION=$(node -p "require('./package.json').version") + if [[ "$VERSION" == *"-"* ]]; then + echo "Publishing pre-release: $VERSION" + npm publish -w packages/git-proxy-cli --access=public --tag rc + else + echo "Publishing stable release: $VERSION" + npm publish -w packages/git-proxy-cli --access=public + fi diff --git a/packages/git-proxy-cli/package.json b/packages/git-proxy-cli/package.json index ebbc97194..6cc0cc186 100644 --- a/packages/git-proxy-cli/package.json +++ b/packages/git-proxy-cli/package.json @@ -5,7 +5,12 @@ "bin": { "git-proxy-cli": "./dist/index.js" }, + "files": [ + "dist" + ], "dependencies": { + "axios": "^1.18.1", + "yargs": "^18.0.0", "@finos/git-proxy": "2.0.0" }, "scripts": { diff --git a/website/docs/quickstart/installation.mdx b/website/docs/quickstart/installation.mdx index ad3681b1a..74773f68e 100644 --- a/website/docs/quickstart/installation.mdx +++ b/website/docs/quickstart/installation.mdx @@ -28,7 +28,7 @@ npm install -g @finos/git-proxy@latest To install a specific version of the GitProxy CLI, append the version to the end of the install command: ```bash -npm install -g @finos/git-proxy-cli@1.0.0 +npm install -g @finos/git-proxy-cli@2.0.0 ``` ### Install a local checkout