From f144c5d0a312a7e7fe3eff167b214472dc6ea376 Mon Sep 17 00:00:00 2001 From: zyc9012 Date: Fri, 5 Apr 2024 15:34:06 +0800 Subject: [PATCH] Support publishing npm package via CI --- .github/workflows/ci.yml | 17 ++++++++--------- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 678e9ed5..11171e76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,12 +4,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'yarn' - - run: yarn install --frozen-lockfile - - run: yarn tsc - - run: yarn lint - - run: yarn test \ No newline at end of file + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 16 + cache: "yarn" + - run: yarn tsc + - run: yarn lint + - run: yarn test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c0865157 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: push +# on: +# release: +# types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 16 + registry-url: "https://registry.npmjs.org" + cache: "yarn" + - run: yarn tsc + - run: yarn lint + - run: yarn test + - run: yarn build + - run: cd packages/core && npm pack + - run: cd packages/react && npm pack + - uses: actions/upload-artifact@v4 + with: + name: packages + path: | + packages/core/fortune-sheet-core-*.tgz + packages/react/fortune-sheet-react-*.tgz + # - run: npm publish + # env: + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}