From e9e7552e2fa0d014393f19adc496f45f0a2a3678 Mon Sep 17 00:00:00 2001 From: Ross Stenersen Date: Tue, 16 Dec 2025 14:27:15 -0600 Subject: [PATCH 1/6] chore: update prep for releasing ESM and yargs-based CLI as version 2.0 --- .changeset/cuddly-ants-look.md | 5 + .eslintrc.cjs | 2 +- .github/workflows/cd.yaml | 205 +++++++++++++------------ .github/workflows/ci.yaml | 8 +- .gitignore | 2 + CHANGELOG.md | 10 +- functional-tests/requirements.txt | 9 +- functional-tests/tests/version_test.py | 2 +- generate-release-notes.mjs | 10 -- package-lock.json | 4 +- src/build-tools/build-binaries.ts | 2 +- 11 files changed, 138 insertions(+), 121 deletions(-) create mode 100644 .changeset/cuddly-ants-look.md delete mode 100644 generate-release-notes.mjs diff --git a/.changeset/cuddly-ants-look.md b/.changeset/cuddly-ants-look.md new file mode 100644 index 00000000..f44b63d9 --- /dev/null +++ b/.changeset/cuddly-ants-look.md @@ -0,0 +1,5 @@ +--- +"@smartthings/cli": major +--- + +refactor to use yargs diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 99211af6..24836452 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,7 +27,7 @@ module.exports = { parserOptions: { ecmaVersion: 2019, tsconfigRootDir: __dirname, - project: ['./tsconfig.json', './tsconfig-test.json'], + project: ['./tsconfig.json'], }, rules: { indent: 'off', diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index b0215b44..05d2b486 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -8,7 +8,7 @@ on: concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: - release: + npm-release: # don't run on forks if: ${{ github.repository_owner == 'SmartThingsCommunity' }} @@ -17,16 +17,15 @@ jobs: runs-on: ubuntu-latest outputs: - cli-released: ${{ steps.cli-release.outputs.published }} cli-version: ${{ steps.cli-metadata.outputs.version }} cli-tag: ${{ steps.cli-metadata.outputs.tag }} steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v6.0.1 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v6.1.0 with: node-version: 24.8.0 @@ -35,7 +34,7 @@ jobs: - name: Create Release Pull Request or Publish to npm id: changesets - uses: changesets/action@v1 + uses: changesets/action@v1.5.3 with: version: npm run version publish: npm run release @@ -46,18 +45,22 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # decouple Github Release from library-only publishing - - name: Check if CLI Published - id: cli-release - run: echo "published=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq 'any(.name == "@smartthings/cli")')" >> $GITHUB_OUTPUT + - name: Debug Published Packages + run: | + echo "Published Packages:" + echo '${{ steps.changesets.outputs.publishedPackages }}' | jq . - name: Derive Required Metadata id: cli-metadata - if: steps.cli-release.outputs.published == 'true' run: | # derive latest info from changesets output - PUBLISHED_PACKAGE=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq 'map(select(.name == "@smartthings/cli")) | .[]') - echo "tag=$(echo $PUBLISHED_PACKAGE | jq --raw-output '.name + "@" + .version')" >> $GITHUB_OUTPUT - echo "version=$(echo $PUBLISHED_PACKAGE | jq --raw-output '.version')" >> $GITHUB_OUTPUT + published_package=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq 'map(select(.name == "@smartthings/cli")) | .[]') + echo "tag=$(echo $published_package | jq --raw-output '.name + "@" + .version')" >> $GITHUB_OUTPUT + echo "version=$(echo $published_package | jq --raw-output '.version')" >> $GITHUB_OUTPUT + + - name: Debug Version + run: | + echo "CLI Tag: ${{ steps.cli-metadata.outputs.tag }}" + echo "CLI Version: ${{ steps.cli-metadata.outputs.version }}" package: name: Package CLI @@ -65,23 +68,11 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install and Setup QEMU - run: | - sudo apt update - sudo apt install binfmt-support qemu-user-static - - # see https://github.com/vercel/pkg/issues/1251#issuecomment-1024832725 - - name: Download and Install ldid Codesign Utility - run: | - wget https://github.com/jesec/ldid-static/releases/download/v2.1.4/ldid-amd64 - chmod +x ldid-amd64 - sudo mv ldid-amd64 /usr/local/bin/ldid - - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v6.0.1 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v6.1.0 with: node-version: 24.8.0 @@ -91,16 +82,21 @@ jobs: - name: Package CLI run: npm run package - # maintain executable file permissions - # see https://github.com/actions/upload-artifact/issues/38 - - name: Tar files - run: tar -cvf dist_bin.tar packages/cli/dist_bin/ + - name: Debug List Files after Packaging + run: ls -lR dist_bin - name: Upload Artifacts - uses: actions/upload-artifact@v4.4.0 + id: upload-artifacts + uses: actions/upload-artifact@v6.0.0 with: - name: dist_bin - path: dist_bin.tar + name: Binaries + path: | + dist_bin/*.tgz + dist_bin/*.zip + + - name: Debug Artifact Ids + run: | + echo "Artifact Id: ${{ steps.upload-artifacts.outputs.artifact-id }}" functional-test: needs: package @@ -115,84 +111,101 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6.0.1 - - name: Download Artifacts - uses: actions/download-artifact@v4.1.8 + - name: Download Binaries + uses: actions/download-artifact@v7.0.0 with: - name: dist_bin + name: Binaries + + - name: Debug List Files after Download, Windows + if: runner.os == 'Windows' + run: Get-ChildItem -Path dist_bin + + - name: Debug List Files after Download + if: runner.os != 'Windows' + run: ls -l dist_bin + + - name: Extract Linux Binary + if: runner.os == 'Linux' + run: tar xvf dist_bin/smartthings-linux-x64.tgz + + - name: Extract MacOS Binary + if: runner.os == 'macOS' + run: tar xvf dist_bin/smartthings-mac-arm64.tgz - - name: Extract Artifacts - run: tar -xvf dist_bin.tar + - name: Extract Windows Binary + if: runner.os == 'Windows' + run: Expand-Archive -Path dist_bin\smartthings-windows-x64.zip -DestinationPath "${{ github.workspace }}" - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v6.1.0 with: - python-version: '3.11.5' + python-version: '3.14.2' cache: 'pip' - # make sure 'smartthings' is available to child processes + - name: Debug List Files after Extraction, Windows + if: runner.os == 'Windows' + run: Get-ChildItem + + - name: Debug List Files after Extraction + if: runner.os != 'Windows' + run: ls -l + + # Make sure 'smartthings' binary is available to child processes (i.e. included in PATH). - name: Set Windows Path if: runner.os == 'Windows' - run: Add-Content $env:GITHUB_PATH "${{ github.workspace }}\packages\cli\dist_bin\win\x64" - - name: Set macOS Path - if: runner.os == 'macOS' - run: echo "$GITHUB_WORKSPACE/packages/cli/dist_bin/macos/x64" >> $GITHUB_PATH - - name: Set Linux Path - if: runner.os == 'Linux' - run: echo "$GITHUB_WORKSPACE/packages/cli/dist_bin/linux/x64" >> $GITHUB_PATH + run: Add-Content $env:GITHUB_PATH "${{ github.workspace }}" + - name: Set Path + if: runner.os != 'Windows' + run: echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH - name: Install Dependencies and Run Tests + working-directory: functional-tests run: | - python -m pip install --force-reinstall -v pip==23.3.1 + python -m pip install --force-reinstall -v pip==25.3 pip install -r requirements.txt pytest - working-directory: packages/cli/functional-tests github-release: - needs: [release, package] - - if: needs.release.outputs.cli-released == 'true' + needs: [npm-release, package] name: Create Github Release runs-on: ubuntu-latest steps: + - name: Debug Version + run: | + echo "CLI Version: ${{ needs.npm-release.outputs.cli-version }}" + echo "CLI Tag: ${{ needs.npm-release.outputs.cli-tag }}" + - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v6.0.1 - name: Download Artifacts - uses: actions/download-artifact@v4.1.8 + uses: actions/download-artifact@v7.0.0 with: - name: dist_bin + name: Binaries - - name: Extract Artifacts - run: tar -xvf dist_bin.tar + - name: Debug Downloaded Artifacts + run: ls -l dist_bin/smartthings-*.{tgz,zip} - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v6.1.0 with: node-version: 24.8.0 - - run: npm ci - - # hack since Github auto generated notes aren't working right now - - name: Generate Github Release Notes - run: node generate-release-notes.mjs ${{ needs.release.outputs.cli-version }} - - name: Create Github Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2.5.0 with: - name: ${{ needs.release.outputs.cli-version }} - body_path: ${{ github.workspace }}/RELEASE_NOTES.txt - tag_name: ${{ needs.release.outputs.cli-tag }} + name: ${{ needs.npm-release.outputs.cli-version }} + tag_name: ${{ needs.npm-release.outputs.cli-tag }} + generate_release_notes: true prerelease: false - files: 'packages/cli/dist_bin/**/*.@(tgz|zip)' + files: 'dist_bin/smartthings-*.{tgz,zip}' homebrew-formula: - needs: [release, github-release] - - if: needs.release.outputs.cli-released == 'true' + needs: [npm-release, github-release] name: Bump Homebrew Formula @@ -200,10 +213,10 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v6.0.1 - name: Configure Git Identity - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main with: username: smartthingspi @@ -211,15 +224,13 @@ jobs: run: brew tap smartthingscommunity/smartthings - name: Bump Formula - uses: Homebrew/actions/bump-formulae@master + uses: Homebrew/actions/bump-packages@main with: token: ${{ secrets.HOMEBREW_COMMITTER_TOKEN }} formulae: smartthingscommunity/smartthings/smartthings windows-installer: - needs: [release, package, github-release] - - if: needs.release.outputs.cli-released == 'true' + needs: [npm-release, package, github-release] name: Release Windows Installer @@ -228,29 +239,33 @@ jobs: runs-on: windows-2022 steps: - - name: Print needs.release.outputs.cli-version - run: Write-Output ${{ needs.release.outputs.cli-version }} + - name: Print needs.npm-release.outputs.cli-version + run: Write-Output ${{ needs.npm-release.outputs.cli-version }} # remove any pre-release labels since WiX doesn't support them - name: Sanitize CLI Version String id: safe-semver - run: echo "version=$('${{ needs.release.outputs.cli-version }}'.Split('-') | Select-Object -Index 0)" >> $env:GITHUB_OUTPUT + run: echo "version=$('${{ needs.npm-release.outputs.cli-version }}'.Split('-') | Select-Object -Index 0)" >> $env:GITHUB_OUTPUT - name: Print steps.safe-semver.outputs.version run: Write-Output ${{ steps.safe-semver.outputs.version }} - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v6.0.1 - name: Download Artifacts - uses: actions/download-artifact@v4.1.8 + uses: actions/download-artifact@v7.0.0 with: - name: dist_bin + name: Binaries + + - name: Debug List Files after Download + run: Get-ChildItem -Path dist_bin - - name: Extract Artifacts - run: tar -xvf dist_bin.tar + - name: Extract Windows Binary + run: Expand-Archive -Path dist_bin\smartthings-windows-x64.zip -DestinationPath "${{ github.workspace }}\wix" - - run: mv packages\cli\dist_bin\win\x64\smartthings.exe packages\cli\wix + - name: Debug List Files after Extraction + run: Get-ChildItem -Path .\wix # https://github.community/t/set-path-for-wix-toolset-in-windows-runner/154708/2 # https://stackoverflow.com/a/71579543 @@ -259,7 +274,7 @@ jobs: - name: Compile WiX file run: candle.exe smartthings.wxs -ext WixUIExtension -arch x64 - working-directory: packages\cli\wix + working-directory: wix env: SMARTTHINGS_SEMVER: ${{ steps.safe-semver.outputs.version }} # must be absolute path or relative to .wxs file @@ -267,10 +282,10 @@ jobs: - name: Build .msi run: light.exe -out smartthings.msi smartthings.wixobj -ext WixUIExtension - working-directory: packages\cli\wix + working-directory: wix - name: Add .msi Artifact to Github Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2.5.0 with: - tag_name: ${{ needs.release.outputs.cli-tag }} - files: packages/cli/wix/smartthings.msi + tag_name: ${{ needs.npm-release.outputs.cli-tag }} + files: wix/smartthings.msi diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c50a0a81..c1cf60e3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6.0.1 with: fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v6.1.0 with: node-version: 24.8.0 - run: npm ci @@ -27,9 +27,9 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6.0.1 - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v6.1.0 with: node-version: ${{ matrix.node-version }} - run: npm ci diff --git a/.gitignore b/.gitignore index d2293e16..af915875 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ packages/edge/lib # functional tests .pytest_cache __pycache__ + +.github/copilot-instructions.md diff --git a/CHANGELOG.md b/CHANGELOG.md index a5ff654f..73f64d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,18 +3,18 @@ ## 2.0.0 * All commands now have examples in their help (`smartthings --help`). -* args that require enum-like types are now case-insensitive. e.g. You can now list zigbee devices - with `smartthings devices --type zigbee`. +* args that require enum-like types are now case-insensitive. e.g. For example, you can now list zigbee + devices with `smartthings devices --type zigbee`. * The config file location is now determined by [envPaths](https://www.npmjs.com/package/env-paths) library rather than oclif. A reasonable attempt has been made at finding the old config and copying it for - the user so normally no change is needed other than making changes in the new file if necessary. - The `config` command now displays the name of the configuration file. + the user so normally no change is needed. (Future changes will need to be made to the new file, of course.) + The `config` command now displays the location of the configuration file. * Commands that take a capability specification on the command line now get the version from a flag rather than an argument. e.g. `smartthings capabilities myteam.myCapability --capability-version 1` instead of `smartthings capabilities myteam.myCapability 1`. Note that the version is always one, so this flag is not necessary at this time. * Under-the-hood changes to make the CLI more maintainable. -* `--token` flag is no longer included in usage info (i.e. it does not show up when running `--help`) +* The `--token` flag is no longer included in usage info (i.e. it does not show up when running `--help`) but it still works. ## 1.10.6 diff --git a/functional-tests/requirements.txt b/functional-tests/requirements.txt index 4793c7f8..8983a05b 100644 --- a/functional-tests/requirements.txt +++ b/functional-tests/requirements.txt @@ -1,2 +1,7 @@ -pexpect == 4.8.0 -pytest == 7.4.2 +iniconfig==2.3.0 +packaging==25.0 +pexpect==4.9.0 +pluggy==1.6.0 +ptyprocess==0.7.0 +Pygments==2.19.2 +pytest==9.0.2 diff --git a/functional-tests/tests/version_test.py b/functional-tests/tests/version_test.py index 1c9baa87..7aca01bd 100644 --- a/functional-tests/tests/version_test.py +++ b/functional-tests/tests/version_test.py @@ -9,4 +9,4 @@ def test_version_output(): logfile=sys.stdout ) - process.expect('@smartthings/cli/.+ .+ node-.+') + process.expect('^\\d+\\.\\d+\\.\\d+') diff --git a/generate-release-notes.mjs b/generate-release-notes.mjs deleted file mode 100644 index ee39498d..00000000 --- a/generate-release-notes.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { readFile, writeFile } from 'node:fs/promises' - -import { getChangelogEntry } from '@changesets/release-utils' - - -const changelog = await readFile('CHANGELOG.md', 'utf-8') -const version = process.argv[2] - -const content = getChangelogEntry(changelog, version).content -await writeFile('RELEASE_NOTES.txt', content) diff --git a/package-lock.json b/package-lock.json index 438de260..836fb889 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@smartthings/cli", - "version": "2.0.0-prerelease1", + "version": "2.0.0-prerelease2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@smartthings/cli", - "version": "2.0.0-prerelease1", + "version": "2.0.0-prerelease2", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-lambda": "^3.899.0", diff --git a/src/build-tools/build-binaries.ts b/src/build-tools/build-binaries.ts index fd68486e..9f9bfc04 100644 --- a/src/build-tools/build-binaries.ts +++ b/src/build-tools/build-binaries.ts @@ -64,7 +64,7 @@ const buildAndZipTarget = async (target: string): Promise => { ? ['zip', 'zip', {}] : ['tgz', 'tar', { gzip: true }] - const archiveName = path.join(binDir, `smartthings-${platform}-${arch}.${archiveExt}`) + const archiveName = path.join(distBinDir, `smartthings-${platform}-${arch}.${archiveExt}`) const archive = archiver(compressionFormat, config) archive.append(fs.createReadStream(fullBinaryFilename), { name: binaryFilename, mode: 0o755 }) From 209f643ee200d179ca02faf55978c7637f76e7c5 Mon Sep 17 00:00:00 2001 From: Ross Stenersen Date: Mon, 22 Dec 2025 10:57:57 -0600 Subject: [PATCH 2/6] chore: (hopefully) fix to build process --- .github/workflows/cd.yaml | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 05d2b486..4c19eee6 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -120,23 +120,23 @@ jobs: - name: Debug List Files after Download, Windows if: runner.os == 'Windows' - run: Get-ChildItem -Path dist_bin + run: Get-ChildItem - name: Debug List Files after Download if: runner.os != 'Windows' - run: ls -l dist_bin + run: ls -l - name: Extract Linux Binary if: runner.os == 'Linux' - run: tar xvf dist_bin/smartthings-linux-x64.tgz + run: tar xvf smartthings-linux-x64.tgz - name: Extract MacOS Binary if: runner.os == 'macOS' - run: tar xvf dist_bin/smartthings-mac-arm64.tgz + run: tar xvf smartthings-mac-arm64.tgz - name: Extract Windows Binary if: runner.os == 'Windows' - run: Expand-Archive -Path dist_bin\smartthings-windows-x64.zip -DestinationPath "${{ github.workspace }}" + run: Expand-Archive -Path smartthings-windows-x64.zip -DestinationPath "${{ github.workspace }}" - uses: actions/setup-python@v6.1.0 with: @@ -188,7 +188,7 @@ jobs: name: Binaries - name: Debug Downloaded Artifacts - run: ls -l dist_bin/smartthings-*.{tgz,zip} + run: ls -l smartthings-*.{tgz,zip} - name: Setup Node.js uses: actions/setup-node@v6.1.0 @@ -202,7 +202,7 @@ jobs: tag_name: ${{ needs.npm-release.outputs.cli-tag }} generate_release_notes: true prerelease: false - files: 'dist_bin/smartthings-*.{tgz,zip}' + files: 'smartthings-*.{tgz,zip}' homebrew-formula: needs: [npm-release, github-release] @@ -259,10 +259,10 @@ jobs: name: Binaries - name: Debug List Files after Download - run: Get-ChildItem -Path dist_bin + run: Get-ChildItem - name: Extract Windows Binary - run: Expand-Archive -Path dist_bin\smartthings-windows-x64.zip -DestinationPath "${{ github.workspace }}\wix" + run: Expand-Archive -Path smartthings-windows-x64.zip -DestinationPath "${{ github.workspace }}\wix" - name: Debug List Files after Extraction run: Get-ChildItem -Path .\wix diff --git a/package.json b/package.json index 8333dfd3..cdd41889 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "test-watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch --reporters=default", "test-coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage=true", "prepack": "tsc && npm run readme", - "version": "npm run readme && git add README.md && changeset version && npm i --package-lock-only && npm run build && npm run version -w packages/cli", + "version": "npm run build && npm run readme && git add README.md && changeset version && npm i --package-lock-only && npm run compile && npm run version -w packages/cli", "release": "npm run build && changeset publish", "package": "tsx src/build-tools/build-binaries.ts" }, From 140f8b6345b5f879679981a23f71711825ebdfd7 Mon Sep 17 00:00:00 2001 From: Ross Stenersen Date: Mon, 22 Dec 2025 11:28:11 -0600 Subject: [PATCH 3/6] chore: fix another build issue --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cdd41889..c1a2b37e 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "test-watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch --reporters=default", "test-coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage=true", "prepack": "tsc && npm run readme", - "version": "npm run build && npm run readme && git add README.md && changeset version && npm i --package-lock-only && npm run compile && npm run version -w packages/cli", + "version": "npm run build && npm run readme && git add README.md && changeset version && npm i --package-lock-only && npm run compile", "release": "npm run build && changeset publish", "package": "tsx src/build-tools/build-binaries.ts" }, From 5c72948536d7e4bab3d35086b6ed4d86c228ba43 Mon Sep 17 00:00:00 2001 From: Ross Stenersen Date: Mon, 22 Dec 2025 12:05:32 -0600 Subject: [PATCH 4/6] chore: put back released check but get published status directly from changesets --- .github/workflows/cd.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 4c19eee6..c02cabbe 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -12,11 +12,12 @@ jobs: # don't run on forks if: ${{ github.repository_owner == 'SmartThingsCommunity' }} - name: Release + name: NPM Release runs-on: ubuntu-latest outputs: + cli-released: ${{ steps.changesets.outputs.published }} cli-version: ${{ steps.cli-metadata.outputs.version }} cli-tag: ${{ steps.cli-metadata.outputs.tag }} @@ -47,8 +48,8 @@ jobs: - name: Debug Published Packages run: | - echo "Published Packages:" - echo '${{ steps.changesets.outputs.publishedPackages }}' | jq . + echo 'Published Packages: ${{ steps.changesets.outputs.publishedPackages }}' | jq . + echo 'Published: ${{ steps.changesets.outputs.published }}' - name: Derive Required Metadata id: cli-metadata @@ -169,6 +170,8 @@ jobs: github-release: needs: [npm-release, package] + if: needs.npm-release.outputs.cli-released == 'true' + name: Create Github Release runs-on: ubuntu-latest @@ -207,6 +210,8 @@ jobs: homebrew-formula: needs: [npm-release, github-release] + if: needs.npm-release.outputs.cli-released == 'true' + name: Bump Homebrew Formula runs-on: macos-latest @@ -232,6 +237,8 @@ jobs: windows-installer: needs: [npm-release, package, github-release] + if: needs.npm-release.outputs.cli-released == 'true' + name: Release Windows Installer # ensure WiX Toolset is installed on image before updating runner From 9507cd17eb86721c05c0a8e274112910996a27e7 Mon Sep 17 00:00:00 2001 From: Ross Stenersen Date: Mon, 22 Dec 2025 13:37:48 -0600 Subject: [PATCH 5/6] chore: fix bug in debug output for building release --- .github/workflows/cd.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index c02cabbe..7a3ecfe8 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -48,7 +48,8 @@ jobs: - name: Debug Published Packages run: | - echo 'Published Packages: ${{ steps.changesets.outputs.publishedPackages }}' | jq . + echo 'Published Packages:' + echo '${{ steps.changesets.outputs.publishedPackages }}' | jq . echo 'Published: ${{ steps.changesets.outputs.published }}' - name: Derive Required Metadata From 0aa12b4e5e7abfe49fbefeca6a5bbe60fb035d4c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 19:48:11 +0000 Subject: [PATCH 6/6] chore(changesets): version packages --- .changeset/cuddly-ants-look.md | 5 ----- CHANGELOG.md | 12 ++++++------ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 .changeset/cuddly-ants-look.md diff --git a/.changeset/cuddly-ants-look.md b/.changeset/cuddly-ants-look.md deleted file mode 100644 index f44b63d9..00000000 --- a/.changeset/cuddly-ants-look.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@smartthings/cli": major ---- - -refactor to use yargs diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f64d04..67ad7533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,19 +2,19 @@ ## 2.0.0 -* All commands now have examples in their help (`smartthings --help`). -* args that require enum-like types are now case-insensitive. e.g. For example, you can now list zigbee +- All commands now have examples in their help (`smartthings --help`). +- args that require enum-like types are now case-insensitive. e.g. For example, you can now list zigbee devices with `smartthings devices --type zigbee`. -* The config file location is now determined by [envPaths](https://www.npmjs.com/package/env-paths) library +- The config file location is now determined by [envPaths](https://www.npmjs.com/package/env-paths) library rather than oclif. A reasonable attempt has been made at finding the old config and copying it for the user so normally no change is needed. (Future changes will need to be made to the new file, of course.) The `config` command now displays the location of the configuration file. -* Commands that take a capability specification on the command line now get the version from a flag +- Commands that take a capability specification on the command line now get the version from a flag rather than an argument. e.g. `smartthings capabilities myteam.myCapability --capability-version 1` instead of `smartthings capabilities myteam.myCapability 1`. Note that the version is always one, so this flag is not necessary at this time. -* Under-the-hood changes to make the CLI more maintainable. -* The `--token` flag is no longer included in usage info (i.e. it does not show up when running `--help`) +- Under-the-hood changes to make the CLI more maintainable. +- The `--token` flag is no longer included in usage info (i.e. it does not show up when running `--help`) but it still works. ## 1.10.6 diff --git a/package-lock.json b/package-lock.json index 836fb889..62ba9b72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@smartthings/cli", - "version": "2.0.0-prerelease2", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@smartthings/cli", - "version": "2.0.0-prerelease2", + "version": "2.0.0", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-lambda": "^3.899.0", diff --git a/package.json b/package.json index c1a2b37e..b1eb5308 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@smartthings/cli", - "version": "2.0.0-prerelease2", + "version": "2.0.0", "description": "Command Line Interface for the SmartThings APIs", "keywords": [ "smartthings",