Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: 更新项目构建和发布流程 #3

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
paths:
- '**/*.ts'
pull_request:
branches:
- main
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Package binaries
run: pnpm package
- name: Commit and Push
run: |
git add CHANGELOG.md
git commit -m "chore: update changelog"
git push


- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: |
bin/ai-markdown-translator-linux
bin/ai-markdown-translator-macos
bin/ai-markdown-translator-win.exe
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file removed bin/ai-markdown-translator-linux
Binary file not shown.
Binary file removed bin/ai-markdown-translator-macos
Binary file not shown.
Binary file removed bin/ai-markdown-translator-win.exe
Binary file not shown.
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"package": "pkg .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,md}\"",
Expand All @@ -19,14 +18,14 @@
"bin": {
"ai-markdown-translator": "dist/index.js"
},
"pkg": {
"targets": [
"node18-linux-x64",
"node18-macos-x64",
"node18-win-x64"
],
"outputPath": "bin"
},
"files": [
"dist/index.js",
"src/**/*",
"LICENSE",
"README.md",
"README-zh.md",
"CHANGELOG.md"
],
"dependencies": {
"axios": "^1.4.0",
"dotenv": "^16.0.3",
Expand All @@ -44,7 +43,6 @@
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^9.1.7",
"pkg": "^5.8.1",
"prettier": "^2.0.0",
"typescript": "^5.1.6"
},
Expand Down
Loading