From 48f900baa7b95dbef7d9d21c09c68d78b2bbd600 Mon Sep 17 00:00:00 2001 From: hubert Date: Mon, 25 Mar 2024 16:28:55 +0800 Subject: [PATCH] chore: deploy workflow --- .github/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++++++++ README.md | 5 ++-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..23a1ec9 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy + +on: + # release: + # types: [published] + push: # push 到主分支自动 发布 + branches: ['master'] + paths-ignore: # 忽略一些不必要的文件 + - '.gitignore' + - 'README.md' + - '.vscode/**' + +jobs: + publish: + runs-on: ubuntu-latest + environment: + name: 'production' + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '16.14' + - name: Cache install + uses: actions/cache@v3 + id: cache + with: + path: | + node_modules + .yarn/cache + key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install --mode=skip-build + - name: Authenticate with Registry + run: | + echo "registry=http://registry.npmjs.org/" >> .npmrc + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc + npm whoami + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish + run: lerna publish --yes diff --git a/README.md b/README.md index 11fb673..788ce8d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Utils -公共工具库 +公共工具库 +[![Deploy](https://github.com/aceHubert//ace-util/actions/workflows/deploy.yml/badge.svg?branch=master)](https://github.com/aceHubert//ace-util/actions/workflows/deploy.yml) -[Core](./packages/core/README.md) +* [Core Documentation](./packages/core/README.md)