From acff9dbcd5d1176c38ad091901ede7857744f038 Mon Sep 17 00:00:00 2001 From: j m <1406993111@qq.com> Date: Sat, 11 May 2024 09:27:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{node.js.yml => build.yml} | 3 ++- gulpfile.js | 9 +++++++++ package.json | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) rename .github/workflows/{node.js.yml => build.yml} (95%) diff --git a/.github/workflows/node.js.yml b/.github/workflows/build.yml similarity index 95% rename from .github/workflows/node.js.yml rename to .github/workflows/build.yml index 37998cd..952c889 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,9 @@ jobs: cache: 'npm' - name: Install dependencies run: npm install + # Actions构建 - name: Build - run: npm run build + run: npm run actions # 上传构建产物zip - name: Upload artifacts uses: actions/upload-artifact@v4 diff --git a/gulpfile.js b/gulpfile.js index 06d60cc..47a9474 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -129,6 +129,12 @@ task('zip', () => { .pipe(dest(distPath)) }) +task('actions-build', () => { + const target = ['./templates/**', './*.yaml', 'README.md', 'LICENSE'] + return src(target, {base: '.'}) + .pipe(dest(distPath)) +}) + task('publish', (done) => { // 需要将tag标签内容置为 latest process.env.npm_config_tag = 'latest' @@ -142,5 +148,8 @@ task('default', series('clean', parallel('css', 'js'), 'zip')) // release模式,需要使用--tag参数指定版本号 task('release', series('clean', 'version', parallel('css', 'js'), 'zip')) +// GitHub - Actions模式 +task('actions', series('clean', parallel('css', 'js'), 'actions-build')) + // push模式,需要使用--tag参数指定版本号 task('push', series('clean', 'version', parallel('css', 'js'), 'zip', 'publish')) diff --git a/package.json b/package.json index c4491c1..7006d47 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "release": "eslint src/**/*.js && gulp release", + "actions": "eslint src/**/*.js && gulp actions", "push": "eslint src/**/*.js && gulp push", "zip": "gulp zip", "build": "eslint src/**/*.js && gulp",