File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments