From a4314d5a408542afd55e065aac6034d3e9864153 Mon Sep 17 00:00:00 2001 From: Zhiqiang Li Date: Thu, 18 Feb 2021 10:12:59 +0800 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e97a60d..d13a661 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,4 @@ dotnet-cnblog proc -f ![](assets/668104-20201127164901378-1830341075.png) - +Windows 设置右键菜单的方法 https://www.cnblogs.com/shengliC/p/14410298.html From 91ea5c6e9b602ce21d726ea67982c184fdae102a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Jun 2022 00:27:50 +0000 Subject: [PATCH 2/6] Bump Newtonsoft.Json from 12.0.3 to 13.0.1 in /src/dotnet-cnblogs Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.3 to 13.0.1. - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/12.0.3...13.0.1) --- updated-dependencies: - dependency-name: Newtonsoft.Json dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- src/dotnet-cnblogs/dotnet-cnblog.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotnet-cnblogs/dotnet-cnblog.csproj b/src/dotnet-cnblogs/dotnet-cnblog.csproj index 99823af..053927f 100644 --- a/src/dotnet-cnblogs/dotnet-cnblog.csproj +++ b/src/dotnet-cnblogs/dotnet-cnblog.csproj @@ -47,7 +47,7 @@ - + From ff509ea391521fa283b7a11d288b74aa5d52ba11 Mon Sep 17 00:00:00 2001 From: Zhiqiang Li Date: Wed, 29 Jun 2022 19:50:38 +0800 Subject: [PATCH 3/6] Update README.md --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d13a661..97fab83 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,21 @@ dotnet tool install --global dotnet-cnblog 下载地址: https://github.com/stulzq/dotnet-cnblogs-tool/releases -> 因为本工具是开源的,而且使用过程中需要输入密码,所以不要相信任何第三方下载,因为它们有可能被植入恶意代码,仅提供上面两种方式。 +> 因为本工具是开源的,而且使用过程中需要输入 Token,所以不要相信任何第三方下载,因为它们有可能被植入恶意代码,仅提供上面两种方式。 ## 三.使用 -第一次运行需要配置博客ID,账号密码等,按照提示输入即可,对密码采用tea加密算法进行加密存储。 +第一次运行需要配置博客ID,账号、Token等,按照提示输入即可,对密码采用tea加密算法进行加密存储。 ![](assets/668104-20201127164440482-852371747.png) ->需要账号密码是因为调用 MetaWeblog API 需要此信息 +>需要账号、Token 是因为调用 MetaWeblog API 需要此信息 + +Token 申请:https://i.cnblogs.com/settings + +![image](https://user-images.githubusercontent.com/13200155/176429548-bf374aa6-b16f-4b12-a464-c5adcaa86d14.png) + +2022.6.29 更新,请使用 MetaWeblog Token 替换原来的账户密码!!! ### 重置配置 From a955852ef3843ebff7552a9f4cbbc505e02002fe Mon Sep 17 00:00:00 2001 From: InCerry Date: Mon, 11 Jul 2022 10:28:33 +0800 Subject: [PATCH 4/6] Fix the file not found when the image path contains space escape char --- src/dotnet-cnblogs/Command/CommandProcessFile.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dotnet-cnblogs/Command/CommandProcessFile.cs b/src/dotnet-cnblogs/Command/CommandProcessFile.cs index 86f582e..6b7fe20 100644 --- a/src/dotnet-cnblogs/Command/CommandProcessFile.cs +++ b/src/dotnet-cnblogs/Command/CommandProcessFile.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.IO; using System.Linq; +using System.Web; using Dotnetcnblog.TagHandlers; using Dotnetcnblog.Utils; using McMaster.Extensions.CommandLineUtils; @@ -59,7 +60,7 @@ public void Execute(CommandContext context) try { - var imgPhyPath = Path.Combine(fileDir!, img); + var imgPhyPath = HttpUtility.UrlDecode(Path.Combine(fileDir!, img)); if (File.Exists(imgPhyPath)) { var imgUrl = ImageUploadHelper.Upload(imgPhyPath); From 19a516c8152dd1e47af9697946cf3232384ade2a Mon Sep 17 00:00:00 2001 From: Zhiqiang Li Date: Fri, 29 Jul 2022 16:56:20 +0800 Subject: [PATCH 5/6] v1.4.2 --- .gitignore | 1 + src/dotnet-cnblogs/dotnet-cnblog.csproj | 16 ++++++++-------- src/dotnet-cnblogs/publish.bat | 6 ------ src/dotnet-cnblogs/publish.sh | 7 +++++++ 4 files changed, 16 insertions(+), 14 deletions(-) delete mode 100644 src/dotnet-cnblogs/publish.bat create mode 100755 src/dotnet-cnblogs/publish.sh diff --git a/.gitignore b/.gitignore index ebfff7e..20abd17 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,4 @@ Backup*/ UpgradeLog*.XML .vs +.idea/ diff --git a/src/dotnet-cnblogs/dotnet-cnblog.csproj b/src/dotnet-cnblogs/dotnet-cnblog.csproj index 053927f..6d018da 100644 --- a/src/dotnet-cnblogs/dotnet-cnblog.csproj +++ b/src/dotnet-cnblogs/dotnet-cnblog.csproj @@ -18,23 +18,23 @@ cnblogs true - 1.4.1 + 1.4.2 true true snupkg Dotnetcnblog - 升级到 .NET 5.0 并且重构代码,使用方法有小的变更,请查看文档 https://github.com/stulzq/dotnet-cnblogs-tool + 兼容路径 LICENSE - + - + - - true - true - link + + + + false diff --git a/src/dotnet-cnblogs/publish.bat b/src/dotnet-cnblogs/publish.bat deleted file mode 100644 index e81eced..0000000 --- a/src/dotnet-cnblogs/publish.bat +++ /dev/null @@ -1,6 +0,0 @@ -dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true --self-contained true -dotnet publish -c Release -r win-x86 -p:PublishSingleFile=true --self-contained true -dotnet publish -c Release -r osx-x64 -p:PublishSingleFile=true --self-contained true -dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true --self-contained true -dotnet publish -c Release -r linux-arm -p:PublishSingleFile=true --self-contained true -pause \ No newline at end of file diff --git a/src/dotnet-cnblogs/publish.sh b/src/dotnet-cnblogs/publish.sh new file mode 100755 index 0000000..0801d5a --- /dev/null +++ b/src/dotnet-cnblogs/publish.sh @@ -0,0 +1,7 @@ +set -e + +dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IsTrimmable=true -p:TrimMode=link --self-contained true +dotnet publish -c Release -r win-x86 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IsTrimmable=true -p:TrimMode=link --self-contained true +dotnet publish -c Release -r osx-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IsTrimmable=true -p:TrimMode=link --self-contained true +dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IsTrimmable=true -p:TrimMode=link --self-contained true +dotnet publish -c Release -r linux-arm -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IsTrimmable=true -p:TrimMode=link --self-contained true From 7c905003d0605b7a82b8a7c96d16f7aa713b3b9c Mon Sep 17 00:00:00 2001 From: Zhiqiang Li Date: Fri, 29 Jul 2022 17:03:36 +0800 Subject: [PATCH 6/6] add actions --- .github/workflows/release_stable_cli.yaml | 104 ++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/release_stable_cli.yaml diff --git a/.github/workflows/release_stable_cli.yaml b/.github/workflows/release_stable_cli.yaml new file mode 100644 index 0000000..066859d --- /dev/null +++ b/.github/workflows/release_stable_cli.yaml @@ -0,0 +1,104 @@ +name: Release_CLI_Stable + +on: + push: + tags: + - "*.*.*" + - "!*.*.*-beta*" + - "!*.*.*-rc*" + +jobs: + publish_cli: + name: Build and upload cli artifact + runs-on: ubuntu-latest + strategy: + matrix: + targets: + [ + "linux-x64", + "osx-x64", + "win-x86", + ] + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "5.0.x" + - name: Publish .NET app + env: + RID: ${{ matrix.targets }} + VERSION: ${{ github.ref_name }} + run: dotnet publish src/dotnet-cnblogs/dotnet-cnblog.csproj -c Release -r $RID -p:PublishSingleFile=true -p:PublishTrimmed=true -p:DebugType=None -p:DebugSymbols=false -p:EnableCompressionInSingleFile=true --self-contained true --output /home/runner/work/clis/$RID + + - name: Package assets + env: + RID: ${{ matrix.targets }} + VERSION: ${{ github.ref_name }} + run: | + mkdir /home/runner/work/release + ls /home/runner/work/clis/ + zip -j /home/runner/work/release/dotnet-cnblogs.$VERSION.$RID.zip /home/runner/work/clis/$RID/* + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: dotnet-cnblogs + path: /home/runner/work/release + + publish_windows_x64_and_arm_aot: + name: Build and upload windows x64 and arm64 aot cli artifact + runs-on: windows-latest + strategy: + matrix: + targets: + [ + "win-x64", + "win-arm64" + ] + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Setup .NET Core SDK 6.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.x + - name: Publish .NET app + env: + RID: ${{ matrix.targets }} + VERSION: ${{ github.ref_name }} + run: dotnet publish src/dotnet-cnblogs/dotnet-cnblog.csproj -c Release -r $($env:RID) -p:UseAot=true -p:DebugType=None -p:DebugSymbols=false --self-contained true --output ../publish/$($env:RID) + + - name: Package assets + env: + RID: ${{ matrix.targets }} + VERSION: ${{ github.ref_name }} + run: | + mkdir ../release + rm -fo ../publish/$($env:RID)/*.pdb + ls ../publish/ + Compress-Archive -Path ../publish/$($env:RID)/* -DestinationPath ../release/dotnet-cnblogs.$($env:VERSION).$($env:RID).zip + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: dotnet-cnblogs + path: D:/a/dotnet-cnblogs/release + + release_cli: + name: Publish release + needs: ['publish_cli','publish_windows_x64_and_arm_aot'] + runs-on: ubuntu-latest + + steps: + - name: Download build artifacts + uses: actions/download-artifact@v1 + with: + name: dotnet-cnblogs + - name: list dotnet-cnblogs + run: ls dotnet-cnblogs + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: dotnet-cnblogs/** + generate_release_notes: true \ No newline at end of file