Skip to content

Cocos Publish Package to NPM #2

Cocos Publish Package to NPM

Cocos Publish Package to NPM #2

name: Cocos Publish Package to NPM
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: npm install and test
run: |
npm ci
npm test
- name: LKG, clean, and pack
run: |
gulp LKG
gulp clean
npm pack ./
mv cocos-typescript-*.tgz typescript.tgz
- name: Upload built tarfile
uses: actions/upload-artifact@v3
with:
name: tgz
path: typescript.tgz
- uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552
if: github.event_name == 'release'
with:
token: ${{ secrets.NPM_PUBLISH_FOR_PUBLIC_REPO }}
registry: "https://registry.npmjs.org"