File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 2828      - name : Build npm 
2929        run : deno task build 
3030      - name : Publish npm 
31-         run : | 
32-           (cd packages/common && npm publish --provenance --access public) 
33-           (cd packages/bootstrap && npm publish --provenance --access public) 
34-           (cd packages/ts-morph && npm publish --provenance --access public) 
3531        env :
3632          NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }} 
33+         shell : bash 
34+         run : | 
35+           set -euo pipefail 
36+           publish_if_needed() { 
37+             local pkg_dir=$1 
38+             cd "$pkg_dir" 
39+             local name version 
40+             name=$(node -p "require('./package.json').name") 
41+             version=$(node -p "require('./package.json').version") 
42+             if npm view "$name@$version" >/dev/null 2>&1; then 
43+               echo "✅ $name@$version already published — skipping." 
44+             else 
45+               echo "🚀 Publishing $name@$version..." 
46+               npm publish --provenance --access public 
47+             fi 
48+             cd - >/dev/null 
49+           } 
50+ 
51+           publish_if_needed packages/common 
52+           publish_if_needed packages/bootstrap 
53+           publish_if_needed packages/ts-morph 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments