diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..1e0cb78 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,47 @@ +name: 构建和部署npm包 + +on: + push: + branches: + - npm + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: 🚀 检出代码 + uses: actions/checkout@v4 + + - name: 🏗️ 安装 Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org' + + - name: 📦 安装 yarn + run: npm install -g yarn + + - name: 📦 列出node版本 + run: | + pwd + node -v + + - name: 📦 列出npm版本 + run: npm -v + + - name: 📦 列出yarn版本 + run: yarn -v + + - name: 🔧 安装依赖 + run: yarn install + + - name: 🛠️ 构建项目 + run: yarn build + + - name: 🚀 发布npm包 + run: | + ls -l + yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 0fdbdbf..f873c15 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,15 @@ { "name": "yz-yuki-plugin", - "version": "1.0.1", + "version": "1.0.1-rc.0", "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件", "author": "snowtafir", "type": "module", "license": "MIT", "main": "main.js", + "repository": { + "type": "git", + "url": "https://github.com/snowtafir/yuki-plugin.git" + }, "scripts": { "app": "npm run css && node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.js", "dev": "npm run css && nodemon", @@ -70,7 +74,6 @@ "rollup-plugin-copy": "^3.5.0", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-ignore": "^1.0.10", - "rollup-plugin-terser": "^7.0.2", "tailwindcss": "^3.4.3", "ts-node": "^10.9.2", "typescript": "^5.4.5", @@ -85,7 +88,8 @@ "CHANGELOG.md", "README.md", "package.json", - "LICENSE" + "LICENSE", + ".puppeteerrc.cjs" ], "types": "lib/types", "exports": {