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
11 changes: 9 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,19 @@ jobs:
shell: bash
working-directory: npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BOOTSTRAP_NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
name="$(node -p "require('./package.json').name")"
version="$(node -p "require('./package.json').version")"
if npm view "$name@$version" version >/dev/null 2>&1; then
echo "$name@$version is already published"
else
npm publish --access public --provenance
if [[ -n "$BOOTSTRAP_NPM_TOKEN" ]]; then
export NODE_AUTH_TOKEN="$BOOTSTRAP_NPM_TOKEN"
echo "Publishing with the bootstrap npm token"
else
unset NODE_AUTH_TOKEN
echo "Publishing with npm trusted publishing"
fi
npm publish --access public
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ brew install timzhong1024/tap/run-code
You can also install the prebuilt binary through npm:

```bash
npm install --global @timzhong/run-code
npm install --global @timzhong2000/run-code
```

Or install from source:
Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ brew install timzhong1024/tap/run-code
也可以通过 npm 安装预编译 binary:

```bash
npm install --global @timzhong/run-code
npm install --global @timzhong2000/run-code
```

或者从源码安装:
Expand Down
4 changes: 2 additions & 2 deletions npm/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# @timzhong/run-code
# @timzhong2000/run-code

Prebuilt npm distribution of [`run-code`](https://github.com/timzhong1024/run-code).

```bash
echo 'print("hello")' | npx @timzhong/run-code python
echo 'print("hello")' | npx @timzhong2000/run-code python
```

The package selects the bundled binary for the current operating system and CPU architecture.
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@timzhong/run-code",
"name": "@timzhong2000/run-code",
"version": "0.0.0-development",
"description": "Run temporary Python, TypeScript, JavaScript, Rust, Go, or C# snippets with pinned toolchains and dependencies",
"type": "module",
Expand Down