chore(cli): simplify publish step in ci-template (#1812)
* Simplify publish step in ci-template * Update ci-template.ts
This commit is contained in:
parent
f80cdba605
commit
9d62db47e8
1 changed files with 4 additions and 6 deletions
|
@ -543,6 +543,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- name: 'Install dependencies'
|
- name: 'Install dependencies'
|
||||||
run: yarn install
|
run: yarn install
|
||||||
|
@ -561,19 +562,16 @@ jobs:
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: |
|
run: |
|
||||||
npm config set provenance true
|
|
||||||
if git log -1 --pretty=%B | grep "^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$";
|
if git log -1 --pretty=%B | grep "^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$";
|
||||||
then
|
then
|
||||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
npm publish --access public --provenance
|
||||||
npm publish --access public
|
|
||||||
elif git log -1 --pretty=%B | grep "^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+";
|
elif git log -1 --pretty=%B | grep "^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+";
|
||||||
then
|
then
|
||||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
npm publish --tag next --access public --provenance
|
||||||
npm publish --tag next --access public
|
|
||||||
else
|
else
|
||||||
echo "Not a release, skipping publish"
|
echo "Not a release, skipping publish"
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: \${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: \${{ secrets.NPM_TOKEN }}
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in a new issue