Skip to content

Commit deeac12

Browse files
authored
Merge pull request #3 from smithery-ai/chore/npm-publish-workflow
ci: add npm publish workflow
2 parents 332d01e + 5503978 commit deeac12

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: npm publish
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: npm-publish
10+
cancel-in-progress: true
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: oven-sh/setup-bun@v2
20+
with:
21+
bun-version: latest
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
registry-url: https://registry.npmjs.org
27+
28+
- run: bun install
29+
30+
- name: Check if version exists
31+
id: check
32+
run: |
33+
PKG_VERSION=$(node -p "require('./package.json').version")
34+
if npm view @flamecast/cli@$PKG_VERSION version 2>/dev/null; then
35+
echo "exists=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "exists=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Publish
41+
if: steps.check.outputs.exists == 'false'
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.FLAMECAST_CLI_NPM }}
44+
run: npm publish --access public

0 commit comments

Comments
 (0)