diff --git a/.github/workflows/minikube-chectl-release-test.yml b/.github/workflows/minikube-chectl-release-test.yml index 9a1ce1935..4817fab5c 100644 --- a/.github/workflows/minikube-chectl-release-test.yml +++ b/.github/workflows/minikube-chectl-release-test.yml @@ -29,12 +29,11 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.16.1 - - name: Pack chectl binaries - run: yarn && npx oclif-dev pack --targets=linux-x64 - - name: UnPack chectl binaries in $HOME/chectl + - name: Pack chectl binary (single arch target) + run: yarn && yarn prepack && yarn pack-binaries --targets=linux-x64 + - name: Unpack chectl tarball to $HOME/chectl run: | - # Will unpack chectl binaries in $HOME/chectl - tar -xvf dist/channels/*/chectl-linux-x64.tar.gz -C $HOME + tar -xvf $(find dist/ -name "chectl*linux-x64.tar.gz" | head -1) -C $HOME echo "$HOME/chectl/bin" >> $GITHUB_PATH rm -rf tmp/ - name: Run tests diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 64279c2ab..a11a626e0 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -25,7 +25,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.16.1 - - name: Build chectl + - name: Install yarn deps run: yarn - name: Run eslint run: yarn lint @@ -43,16 +43,16 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.16.1 - - name: Build chectl - run: yarn + - name: Build chectl and pack binaries + run: yarn && yarn pack-binaries --targets=linux-x64 - name: Build README.md - run: yarn oclif-dev readme + run: DEBUG=* npx oclif readme - name: Check README.md state run: | IFS=$'\n' read -d '' -r -a FILES_CHANGED_ARRAY < <( git ls-files -m ) || true # check if readme it is up to date if [[ " ${FILES_CHANGED_ARRAY[@]} " =~ "README.md" ]]; then - echo "[ERROR] README.md it is not up to date. Please run 'yarn oclif-dev readme' to update and commit the changes." + echo "[ERROR] README.md it is not up to date. Please run 'yarn oclif readme' to update and commit the changes." exit 1 fi license-validation: diff --git a/.github/workflows/release-build-and-push-to-GH-releases.yml b/.github/workflows/release-build-and-push-to-GH-releases.yml index ddae805d1..e4955e9ee 100644 --- a/.github/workflows/release-build-and-push-to-GH-releases.yml +++ b/.github/workflows/release-build-and-push-to-GH-releases.yml @@ -59,13 +59,13 @@ jobs: git tag ${{ steps.TAG_UTIL.outputs.gh_tag }} TARGETS=linux-arm,linux-x64,linux-s390x,linux-ppc64le,darwin-x64,darwin-arm64,win32-x64,win32-x86 - npx oclif-dev pack --targets=$TARGETS + yarn prepack && yarn pack-binaries --targets=$TARGETS - name: Create Release and push artifacts uses: softprops/action-gh-release@v1 with: name: ${{ steps.TAG_UTIL.outputs.gh_release_name }} tag_name: ${{ steps.TAG_UTIL.outputs.gh_tag }} - files: "./dist/channels/**/chectl-*.gz" + files: "./dist/chectl-*.gz" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update github pages diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a865f5c49..8ae4186e0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -107,7 +107,7 @@ }, { "label": "Update README.md", - "command": "yarn oclif-dev readme", + "command": "yarn oclif readme", "type": "shell", "args": [], "problemMatcher": [ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b75e115b..79d004a21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,11 +64,11 @@ Testing summary will be printed to the output. To test ensure `chectl` is built successfully, launch the `[Chectl] Run` command. It wil run `chectl` with `--help` directive. ## Package binaries -For packaging binaries, [oclif](https://github.com/oclif/dev-cli) is used. It generates packages for Linux, Windows, and MacOS operating systems and puts the result in the `dist/channels/stable` directory. +For packaging binaries, [oclif](https://github.com/oclif/dev-cli) is used. It generates packages for Linux, Windows, and MacOS operating systems and puts the result in the `dist/` directory. To start packaging, just run the `[Chectl] Package Binaries` command. It will run the following in the `/projects/chectl` directory: ```bash -yarn oclif-dev pack +yarn oclif pack tarballs --no-xz --parallel ``` > Note: you need to build your `chectl` before by `yarn` command, or install all node packages by running `npm install` in `/projects/chectl` directory. diff --git a/README.md b/README.md index 6e42a7faf..beff2ebaf 100644 --- a/README.md +++ b/README.md @@ -116,18 +116,24 @@ display autocomplete installation instructions ``` USAGE - $ chectl autocomplete [SHELL] + $ chectl autocomplete [SHELL] [-r] ARGUMENTS SHELL shell type -OPTIONS +FLAGS -r, --refresh-cache Refresh cache (ignores displaying instructions) +DESCRIPTION + display autocomplete installation instructions + EXAMPLES $ chectl autocomplete + $ chectl autocomplete bash + $ chectl autocomplete zsh + $ chectl autocomplete --refresh-cache ``` @@ -139,10 +145,10 @@ Retrieves Eclipse Che self-signed certificate ``` USAGE - $ chectl cacert:export + $ chectl cacert:export [-h] [-n ] [--telemetry on|off] [-d ] -OPTIONS - -d, --destination=destination +FLAGS + -d, --destination= Destination where to store Eclipse Che self-signed CA certificate. If the destination is a file (might not exist), then the certificate will be saved there in PEM format. If the destination is a directory, then cheCA.crt file will be created there with Eclipse Che certificate in PEM @@ -152,11 +158,15 @@ OPTIONS -h, --help show CLI help - -n, --chenamespace=chenamespace + -n, --chenamespace= Eclipse Che Kubernetes namespace. - --telemetry=on|off + --telemetry=