From 0a5ea64d15831c8f668ab137c9bd52c76d53551f Mon Sep 17 00:00:00 2001 From: chenxuan <1607772321@qq.com> Date: Tue, 19 Nov 2024 00:17:45 +0800 Subject: [PATCH] feat:update init.sh --- .clang-tidy | 1 + .github/workflows/release.yml | 36 ++++++++++++++++++--------------- demo/mnist/init.sh | 2 +- demo/use-lib-server-ssl/init.sh | 3 ++- docs/cppnet/utils/string.md | 6 ++++++ 5 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..04fa628 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1 @@ +Checks: -misc-definitions-in-headers diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc4a0d9..fb8e48c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: - 'v*' jobs: - build: + release: strategy: matrix: # 会分开成两个任务分别执行 os: [ubuntu-latest, macos-latest, windows-latest] @@ -35,14 +35,6 @@ jobs: cp ./cppnet.tar.gz ../cppnet-${{ matrix.os }}-release.tar.gz cd .. - # - name: Create Demo Release File - # if: matrix.os == 'ubuntu-latest' - # run: | - # cd demo - # ./build.sh - # tar -zcvf ./cppnet-demo-${{ matrix.os }}.tar.gz ./bin/* - # mv ./cppnet-demo-${{ matrix.os }}.tar.gz ../ - - name: Unix Release uses: softprops/action-gh-release@v2 #具体参考https://github.com/softprops/action-gh-release if: ( matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' ) && startsWith(github.ref, 'refs/tags/') # 设置为有tag才进行上传 @@ -61,10 +53,22 @@ jobs: cppnet-${{ matrix.os }}-release.tar.gz LICENSE - # - name: Demo Release - # uses: softprops/action-gh-release@v2 - # if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') # 设置为有tag才进行上传 - # with: - # files: | - # cppnet-demo-${{ matrix.os }}.tar.gz - # LICENSE + + demo: + needs: release + runs-on: ubuntu-latest + - name: Create Demo Release File + run: | + cd demo + ./build.sh + tar -zcvf ./cppnet-demo-ubuntu.tar.gz ./bin/* + mv ./cppnet-demo-ubuntu.tar.gz ../ + cd .. + + - name: Demo Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') # 设置为有tag才进行上传 + with: + files: | + cppnet-demo-ubuntu.tar.gz + LICENSE diff --git a/demo/mnist/init.sh b/demo/mnist/init.sh index e54dc6b..93d94a9 100755 --- a/demo/mnist/init.sh +++ b/demo/mnist/init.sh @@ -21,7 +21,7 @@ if [ ! -d "./cppnet" ]; then echo "未知系统" exit fi - file_name=cppnet-$sysname-latest-ssl-release.tar.gz + file_name=cppnet-$sysname-latest-release.tar.gz wget https://github.com/chenxuan520/cppnet/releases/latest/download/$file_name tar -zxvf $file_name rm $file_name diff --git a/demo/use-lib-server-ssl/init.sh b/demo/use-lib-server-ssl/init.sh index a92947b..e48a78b 100755 --- a/demo/use-lib-server-ssl/init.sh +++ b/demo/use-lib-server-ssl/init.sh @@ -24,5 +24,6 @@ fi if [ ! -d "./ssl" ]; then mkdir ssl cd ssl - openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout privkey.pem -out cacert.pem -days 3650 + # openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout privkey.pem -out cacert.pem -days 3650 + openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout privkey.pem -out cacert.pem -days 3650 -subj '/C=US/ST=YourState/L=YourCity/O=YourOrganization/OU=YourUnit/CN=example.com' fi diff --git a/docs/cppnet/utils/string.md b/docs/cppnet/utils/string.md index 033088d..8d2c457 100644 --- a/docs/cppnet/utils/string.md +++ b/docs/cppnet/utils/string.md @@ -17,3 +17,9 @@ - `url`:要进行 URL 编码的字符串。 - 返回值:`std::string`类型,编码后的字符串。 - 作用:对给定的字符串进行 URL 编码操作。 +## static bool WildCardMatch(const std::string &pattern, const std::string &source); +- 参数: + - `pattern`:通配符模式。 + - `source`:要匹配的字符串。 +- 返回值:`bool`类型,匹配结果。 +- 作用:使用通配符模式匹配给定的字符串。