From 4cfa2aa66d6b3857fcabdbf9363b60ce41c3806f Mon Sep 17 00:00:00 2001 From: "ROOT\\h7ml" Date: Wed, 11 Dec 2024 20:06:01 +0800 Subject: [PATCH] =?UTF-8?q?ci(workflow):=20=E4=BC=98=E5=8C=96=20GitHub=20A?= =?UTF-8?q?ctions=20=E5=B7=A5=E4=BD=9C=E6=B5=81=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重新排序 pnpm 设置和 Node.js 设置步骤 - 改进错误处理和输出信息 - 更新 README 文件中的版本信息 - 在 package.json 中更新版本号至 1.0.6 - 优化 release 工作流中的错误处理和日志输出 --- .github/workflows/ci.yml | 23 ++++++++++++++--------- .github/workflows/release.yml | 15 ++++++++++----- README-zh.md | 2 +- README.md | 2 +- package.json | 2 +- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 313f5b2..740c8ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,16 +18,16 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '18' + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Get pnpm store directory shell: bash run: | @@ -44,19 +44,24 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: pnpm install --no-frozen-lockfile + run: | + pnpm install --no-frozen-lockfile || (echo "Dependency installation failed" && exit 1) - name: Check format - run: pnpm format:check + run: | + pnpm format:check || echo "Format check failed" - name: Run lint - run: pnpm lint + run: | + pnpm lint || echo "Linting issues detected" - name: Build - run: pnpm build + run: | + pnpm build || (echo "Build failed" && exit 1) - name: Upload build artifacts uses: actions/upload-artifact@v3 with: name: dist path: dist/ + if: success() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 19dccb8..877de40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,13 +39,16 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: pnpm install --no-frozen-lockfile + run: | + pnpm install --no-frozen-lockfile || echo "Dependency installation failed" - name: Build - run: pnpm build + run: | + pnpm build || echo "Build failed" - name: Generate Changelog - run: npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0 + run: | + npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0 || echo "Changelog generation failed" - name: Create Release id: create_release @@ -60,7 +63,8 @@ jobs: prerelease: false - name: Publish to NPM - run: pnpm publish --no-git-checks + run: | + pnpm publish --no-git-checks || echo "Publish to NPM failed" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -72,7 +76,7 @@ jobs: git config advice.ignoredHook false VERSION=${GITHUB_REF#refs/tags/v} git commit -m "chore(release): update CHANGELOG for v$VERSION [skip ci]" -a || echo "No changes to commit" - git push + git push || echo "Push to repository failed" - name: Upload Release Assets uses: softprops/action-gh-release@v1 @@ -80,3 +84,4 @@ jobs: body_path: CHANGELOG.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + continue-on-error: true \ No newline at end of file diff --git a/README-zh.md b/README-zh.md index de74f82..6c6921a 100644 --- a/README-zh.md +++ b/README-zh.md @@ -142,7 +142,7 @@ npx ai-markdown-translator -i input.md -o output.md -l "Italian" ## 版本信息 -- **当前版本**:1.0.5 +- **当前版本**:1.0.6 - **NPM包**:[ai-markdown-translator](https://www.npmjs.com/package/ai-markdown-translator) ## CI信息 diff --git a/README.md b/README.md index 92cdd0c..fd73063 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ npx ai-markdown-translator -i input.md -o output.md -l "Italian" ## Version Information -- **Current Version**: 1.0.5 +- **Current Version**: 1.0.6 - **NPM Package**: [ai-markdown-translator](https://www.npmjs.com/package/ai-markdown-translator) ## CI Information diff --git a/package.json b/package.json index bff99db..6ec0f9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ai-markdown-translator", - "version": "1.0.5", + "version": "1.0.6", "description": "CLI tool to translate Markdown files using OpenAI's language models while preserving the original formatting.", "main": "dist/index.js", "type": "module",