Skip to content

Commit

Permalink
chore: fix: update to oclif v3 instead of archived/obsolete oclif-dev v1
Browse files Browse the repository at this point in the history
Change-Id: Ie5148a80ba50f1a125eebd6f10e2f099d276ee59
Signed-off-by: Nick Boldt <[email protected]>

typo: depend on oclif, not @oclif

Change-Id: I89ca3c931c154413caaa5bf55a1a58753ed70601
Signed-off-by: Nick Boldt <[email protected]>

oclif 3 doesn't use a channel/foo/ path under dist/; also add shasum binary to work around missing shasum on fedora/rhel

Change-Id: I768fa9e8a6a051e17115937efd8948cb95ec28d6
Signed-off-by: Nick Boldt <[email protected]>

use prepack and pack-binaries from package.json instead of hardcoding 'npx oclif pack'

Change-Id: I9b4e049b39908396f157be9bb58525b43bd6b885
Signed-off-by: Nick Boldt <[email protected]>

tarball could be in dist/ or dist/channels/*/

Change-Id: I4c504162f0a9f70b9384c73ffc3efceb19f3eb07
Signed-off-by: Nick Boldt <[email protected]>

wildcards for the filename, eg., ./dist/chectl-v0.0.2-71a78e3-linux-x64.tar.gz

Change-Id: Ifbed461b4a75bd5c04c34036a041ab845c73fa21
Signed-off-by: Nick Boldt <[email protected]>
  • Loading branch information
nickboldt committed Sep 21, 2023
1 parent cef220e commit 94a84c6
Show file tree
Hide file tree
Showing 9 changed files with 2,967 additions and 389 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/minikube-chectl-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-build-and-push-to-GH-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
},
{
"label": "Update README.md",
"command": "yarn oclif-dev readme",
"command": "yarn oclif readme",
"type": "shell",
"args": [],
"problemMatcher": [
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 94a84c6

Please sign in to comment.