From 2d9ae43e2b2e9cfbd9acf8505fb8ef2e84782397 Mon Sep 17 00:00:00 2001 From: Yliu Date: Thu, 2 Nov 2023 20:34:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BB=A5=E5=8F=8ACi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 13 +++++++++---- README.md | 3 +-- addNotes.mjs | 9 ++++++++- rollup.config.mjs | 2 ++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index edbd2ac..420ff83 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,6 +40,12 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get package.json info + id: get_package_info + run: | + echo "::set-output name=name::$(jq -r .name package.json)" + echo "::set-output name=version::$(jq -r .version package.json)" + - name: Zip dist/index.js run: zip -r dist/index.zip dist/index.js @@ -49,10 +55,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v1.0.0 - release_name: Release v1.0.0 - body: | - new zip + tag_name: ${{ steps.get_package_info.outputs.version }} + release_name: ${{ steps.get_package_info.outputs.name }} v${{ steps.get_package_info.outputs.version }} + body: New release draft: false prerelease: false diff --git a/README.md b/README.md index 8d4041c..2ac9840 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ ## 使用方式 -目前因为账号限制,无法在 https://greasyfork.org/zh-CN 发布,所以只能手动拷贝使用。 - ```sh # 方法一,直接拷贝dist/index.js 文件 # 方法二 @@ -20,6 +18,7 @@ git clone 当前项目 pnpm install pnpm run build # 重复方法一 +# 方法三,点开网站点击安装 https://greasyfork.org/zh-CN/scripts/478865-boss%E5%A4%96%E5%8C%85%E5%85%AC%E5%8F%B8%E6%8F%90%E7%A4%BA ``` ## 协议 diff --git a/addNotes.mjs b/addNotes.mjs index 89e5bd9..b4ef29e 100644 --- a/addNotes.mjs +++ b/addNotes.mjs @@ -1,7 +1,13 @@ import { createRequire } from "module"; const require = createRequire(import.meta.url); -const { name, version, author, description } = require("./package.json"); +const { + name, + version, + author, + description, + license, +} = require("./package.json"); export default function addNotes() { return { @@ -17,6 +23,7 @@ export default function addNotes() { // @match https://www.zhipin.com/job_detail/* // @match http://www.zhipin.com/job_detail/* // @grant none +// @license ${license} // ==/UserScript== `.trim(); diff --git a/rollup.config.mjs b/rollup.config.mjs index 829d8d0..8533837 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -15,6 +15,8 @@ export default { commonjs(), addNotes(), esbuild({ + minify: false, + target: "es2015", loaders: { ".json": "json", },