Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/actions/setup-cli/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup CLI
description: Install the DotNS CLI from the latest release or from source
description: Install the DotNS CLI from npm, GitHub release tarball, or from source

inputs:
source:
Expand All @@ -10,12 +10,20 @@ inputs:
runs:
using: composite
steps:
- name: Download latest CLI release
id: download
- name: Install CLI from npm
id: npm-install
if: inputs.source == 'release'
continue-on-error: true
shell: bash
run: npm install -g @parity/dotns-cli

- name: Download CLI release tarball (fallback)
id: download
if: inputs.source == 'release' && steps.npm-install.outcome != 'success'
shell: bash
run: |
set -euo pipefail
echo "::warning::npm install failed, falling back to GitHub release tarball"
RELEASE_DIR="${RUNNER_TEMP}/dotns-cli-release"
rm -rf "$RELEASE_DIR"
mkdir -p "$RELEASE_DIR"
Expand All @@ -25,7 +33,7 @@ runs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GH_TOKEN}" \
https://api.github.com/repos/paritytech/dotns-sdk/releases/latest |
jq -r '.assets[] | select(.name | test("^parity-dotns-cli-.*\\.tgz$")) | .url' |
jq -r '.assets[] | select(.name | test("dotns-cli.*\\.tgz$")) | .url' |
head -n 1
)

Expand All @@ -41,7 +49,7 @@ runs:
"$ASSET_URL" \
-o "$TARBALL_PATH"

echo "tarball=${TARBALL_PATH}" >> "$GITHUB_OUTPUT"
npm install -g "$TARBALL_PATH"
env:
GH_TOKEN: ${{ github.token }}

Expand Down Expand Up @@ -83,11 +91,6 @@ runs:
TARBALL=$(npm pack | tail -n 1)
echo "tarball=${PWD}/${TARBALL}" >> "$GITHUB_OUTPUT"

- name: Install released CLI
if: inputs.source == 'release'
shell: bash
run: npm install -g "${{ steps.download.outputs.tarball }}"

- name: Install built CLI
if: inputs.source == 'source'
shell: bash
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/benchmark-on-demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
Expand Down
Loading