@@ -485,32 +485,21 @@ jobs:
485
485
- name : List packages
486
486
run : ls -R ./npm
487
487
shell : bash
488
- - name : Publish Dev
489
- shell : bash
490
- env :
491
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
492
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
488
+ - name : Publish
489
+ if : contains(github.ref, "main")
493
490
run : |
494
491
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
495
492
npm config set scope "@platformatic"
496
- npm publish --tag dev
497
-
498
- # TODO: Maybe restrict by branch, not just commit format?
499
- # TODO: Enable this when we're ready to go public.
500
- # - name: Publish
501
- # run: |
502
- # npm config set provenance true
503
- # if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
504
- # then
505
- # echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
506
- # npm publish # --access public
507
- # elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
508
- # then
509
- # echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
510
- # npm publish --tag next # --access public
511
- # else
512
- # echo "Not a release, skipping publish"
513
- # fi
514
- # env:
515
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
516
- # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
493
+ npm config set provenance true
494
+ if git log -1 --pretty=%B | grep "^v?[0-9]\+\.[0-9]\+\.[0-9]\+$";
495
+ then
496
+ npm publish --access public
497
+ elif git log -1 --pretty=%B | grep "^v?[0-9]\+\.[0-9]\+\.[0-9]\+";
498
+ then
499
+ npm publish --tag next --access public
500
+ else
501
+ echo "Not a release, skipping publish"
502
+ fi
503
+ env :
504
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
505
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments