Skip to content

Commit d3d6521

Browse files
committed
WIP: Update npm publish
1 parent f98be8c commit d3d6521

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/deploy-production.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Read versions
4646
id: version-check
4747
run: |
48-
OLD=$(git show HEAD~1:packages/ui/package.json | jq -r .version)
48+
OLD=$(npm view @synergycodes/axiom version 2>/dev/null || echo "0.0.0")
4949
NEW=$(jq -r .version packages/ui/package.json)
5050
echo "old=$OLD" >> $GITHUB_OUTPUT
5151
echo "new=$NEW" >> $GITHUB_OUTPUT
@@ -60,21 +60,25 @@ jobs:
6060
6161
pnpm ui build
6262
63-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
64-
6563
cd packages/ui
66-
echo "Publishing @synergycodes/axiom@${{ steps.version-check.outputs.new }} with 'beta' tag…"
67-
pnpm publish --access public --tag beta --no-git-checks
68-
69-
echo "Adding 'latest' dist-tag to @synergycodes/axiom@${{ steps.version-check.outputs.new }}…"
70-
pnpm dist-tag add @synergycodes/axiom@${{ steps.version-check.outputs.new }} latest
71-
72-
rm -f ~/.npmrc
64+
65+
# Check if version contains "beta"
66+
if [[ "${{ steps.version-check.outputs.new }}" == *"beta"* ]]; then
67+
echo "Publishing @synergycodes/axiom@${{ steps.version-check.outputs.new }} with 'beta' tag…"
68+
pnpm publish --tag beta --access public --no-git-checks
69+
70+
echo "Adding 'latest' tag to beta version…"
71+
# INFO: The line below marks each beta version as latest. Once we publish stable version we should remove it
72+
npm dist-tag add @synergycodes/axiom@${{ steps.version-check.outputs.new }} latest
73+
else
74+
echo "Publishing @synergycodes/axiom@${{ steps.version-check.outputs.new }} with 'latest' tag…"
75+
pnpm publish --access public --no-git-checks
76+
fi
7377
else
7478
echo "Version unchanged. Skipping build and publish."
7579
fi
7680
env:
77-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
81+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7882

7983
- name: Deploy Documentation to Production
8084
uses: Azure/static-web-apps-deploy@v1

packages/ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@synergycodes/axiom",
33
"type": "module",
4-
"version": "1.0.0-beta.20",
4+
"version": "1.0.0-beta.20-test-1",
55
"description": "A React library for creating node-based UIs and diagram-driven applications. Perfect for React Flow users, providing ready-to-use node templates and components that work seamlessly with React Flow's ecosystem.",
66
"keywords": [
77
"react",
@@ -81,4 +81,4 @@
8181
"sideEffects": [
8282
"**/*.css"
8383
]
84-
}
84+
}

0 commit comments

Comments
 (0)