From c1369efe0372aa587fc0b3fd5b66a7952fe81314 Mon Sep 17 00:00:00 2001 From: chenshenhai Date: Sun, 15 Oct 2023 11:39:18 +0800 Subject: [PATCH] ci: update github action --- .github/workflows/release.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..45153b7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: npm run test + - run: npm run build + - run: cd packages/types/ + - run: npm publish + - run: cd ../util/ + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}