-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (72 loc) · 2.65 KB
/
Copy pathrelease.yml
File metadata and controls
81 lines (72 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: build_and_release #名称随意
on:
push: #设置触发规则
tags:
- 'v*'
jobs:
release:
strategy:
matrix: # 会分开成两个任务分别执行
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code #这部分是为了从github自动clone代码
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: Create Unix Release File
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
curl https://raw.githubusercontent.com/chenxuan520/gh-action-shell/main/git_commit_message_from_last_tag.sh | bash 1>commit-message.log 2>/dev/null
cd src
./release.sh
cp ./cppnet.tar.gz ../cppnet-${{ matrix.os }}-release.tar.gz
cp ./cppnet-ssl.tar.gz ../cppnet-${{ matrix.os }}-ssl-release.tar.gz
cd ..
- name: Create Windows Release File
if: matrix.os == 'windows-latest'
run: |
cd src
bash ./win_release.sh
cp ./cppnet.tar.gz ../cppnet-${{ matrix.os }}-release.tar.gz
cd ..
- 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才进行上传
with:
body_path: commit-message.log
files: |
cppnet-${{ matrix.os }}-release.tar.gz
cppnet-${{ matrix.os }}-ssl-release.tar.gz
LICENSE
- name: Windows Release
uses: softprops/action-gh-release@v2 #具体参考https://github.com/softprops/action-gh-release
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/') # 设置为有tag才进行上传
with:
files: |
cppnet-${{ matrix.os }}-release.tar.gz
LICENSE
demo:
needs: release
runs-on: ubuntu-latest
steps:
- name: Checkout code #这部分是为了从github自动clone代码
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- 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