Skip to content

Commit deb0e44

Browse files
committed
add workflow
1 parent e6a852a commit deb0e44

File tree

6 files changed

+211
-14
lines changed

6 files changed

+211
-14
lines changed

.github/workflows/release.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
jobs:
9+
build:
10+
name: Upload Release Asset
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
steps:
16+
- name: Cache cargo registry
17+
uses: actions/cache@v1
18+
with:
19+
path: ~/.cargo/registry
20+
key: ${{ runner.os }}-cargo-registry
21+
- name: Cache cargo index
22+
uses: actions/cache@v1
23+
with:
24+
path: ~/.cargo/git
25+
key: ${{ runner.os }}-cargo-index
26+
- name: Cache cargo build
27+
uses: actions/cache@v1
28+
with:
29+
path: target
30+
key: ${{ runner.os }}-cargo-build-target
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
with:
34+
token: ${{ secrets.GH_TOKEN }}
35+
submodules: recursive
36+
- name: Build project
37+
run: |
38+
cargo build --release
39+
- name: Create Release
40+
id: create_release
41+
uses: actions/create-release@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
tag_name: ${{ github.ref }}
46+
release_name: Release ${{ github.ref }}
47+
draft: false
48+
prerelease: false
49+
- name: Upload asset
50+
id: upload-asset
51+
uses: actions/upload-release-asset@v1
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
upload_url: ${{ steps.create_release.outputs.upload_url }}
56+
asset_path: ./target/release/cbsignal_rs
57+
asset_name: cbsignal_rs
58+
asset_content_type: application/octet-stream
59+
- name: Set env
60+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

Cargo.lock

+139-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ hmac = "0.12.1"
3636
hex = "0.4.3"
3737
md-5 = "0.10.6"
3838
ratelimit = "0.9.1"
39+
tracing = "0.1"
40+
tracing-subscriber = { version = "0.3", features = ["json", "env-filter"] } # 日志处理
41+
tracing-appender = "0.2.3"
3942

4043
[profile.release]
4144
overflow-checks = true

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
See config.yaml
66

77
## Run instructions
8-
TODO
8+
sudo ./admin.sh start
99

1010
### Get real-time information of signal service
1111
```

config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ log:
77
log_rotate_size: 1 # rotate 转存大小
88

99
port:
10-
# - 80
11-
- 801
10+
- 80
1211

1312
#tls:
1413
# - port: 4433
@@ -28,7 +27,7 @@ compression:
2827
security:
2928
enable: true # Enable Authentication
3029
maxTimeStampAge: 3600 # Timestamp expiration time in seconds
31-
token: "example" # Custom token, no more than 8 characters
30+
token: example # Custom token, no more than 8 characters
3231

3332

3433

src/stats.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct Info {
2727
security_enabled: bool,
2828
cpu_usage: i32,
2929
internal_ip: String,
30-
compression_enabled: bool,
30+
// compression_enabled: bool,
3131
memory: u64,
3232
cert_infos: Option<Vec<CertInfo>>,
3333
}
@@ -76,10 +76,10 @@ pub async fn get_info(State(state): State<ConfigState>, Query(params): Query<Sta
7676
None => false,
7777
Some(security) => security.enable,
7878
};
79-
let compression_enabled = match state.config.compression {
80-
None => false,
81-
Some(compression) => compression.enable,
82-
};
79+
// let compression_enabled = match state.config.compression {
80+
// None => false,
81+
// Some(compression) => compression.enable,
82+
// };
8383
let mut cert_infos = Vec::new();
8484
if let Some(tls) = state.config.tls {
8585
match tls {
@@ -104,7 +104,7 @@ pub async fn get_info(State(state): State<ConfigState>, Query(params): Query<Sta
104104
security_enabled,
105105
cpu_usage: cpu,
106106
internal_ip: state.local_ip,
107-
compression_enabled,
107+
// compression_enabled,
108108
memory: used_memory,
109109
cert_infos: None,
110110
};

0 commit comments

Comments
 (0)