Skip to content

Commit

Permalink
feat:update init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxuan520 committed Nov 18, 2024
1 parent a564e9e commit 0a5ea64
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checks: -misc-definitions-in-headers
36 changes: 20 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- 'v*'

jobs:
build:
release:
strategy:
matrix: # 会分开成两个任务分别执行
os: [ubuntu-latest, macos-latest, windows-latest]
Expand Down Expand Up @@ -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才进行上传
Expand All @@ -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
2 changes: 1 addition & 1 deletion demo/mnist/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion demo/use-lib-server-ssl/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions docs/cppnet/utils/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@
- `url`:要进行 URL 编码的字符串。
- 返回值:`std::string`类型,编码后的字符串。
- 作用:对给定的字符串进行 URL 编码操作。
## static bool WildCardMatch(const std::string &pattern, const std::string &source);
- 参数:
- `pattern`:通配符模式。
- `source`:要匹配的字符串。
- 返回值:`bool`类型,匹配结果。
- 作用:使用通配符模式匹配给定的字符串。

0 comments on commit 0a5ea64

Please sign in to comment.