Skip to content

Commit 9ec88f0

Browse files
author
root
committed
init
0 parents  commit 9ec88f0

File tree

21 files changed

+2797
-0
lines changed

21 files changed

+2797
-0
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.'cfg(windows)']
2+
rustflags = ["-C", "target-feature=+crt-static"]

.github/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# use
2+
像 BusyBox 一样, 把多个实用命令集合在一个二进制文件中
3+
4+
## 支持的命令
5+
```
6+
Commands:
7+
fs 简易文件浏览器
8+
loop 进程守护
9+
limit 流量超出限制自动关机程序
10+
```

.github/workflows/release.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
# 创建 Github Releases
11+
create-release:
12+
if: startsWith(github.ref, 'refs/tags/')
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
# https://github.com/taiki-e/create-gh-release-action
17+
- uses: taiki-e/create-gh-release-action@v1
18+
with:
19+
# (optional) Path to changelog.
20+
# changelog: CHANGELOG.md
21+
# (required) GitHub token for creating GitHub Releases.
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
# 自动构建跨平台 Rust 二进制文件并上传到 GitHub Release
25+
upload-assets:
26+
needs: create-release
27+
runs-on: ${{ matrix.os }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
# 非本机三元组, 由 corss 通过容器提供交叉编译支持: https://github.com/cross-rs/cross?#supported-targets
33+
# cross 具有与 Cargo 完全相同的 CLI, 但依赖于 Docker 或 Podman
34+
- target: x86_64-unknown-linux-musl
35+
os: ubuntu-latest
36+
- target: aarch64-unknown-linux-musl
37+
os: ubuntu-latest
38+
# 本机三元组, cargo 直接编译
39+
- target: aarch64-apple-darwin
40+
os: macos-latest
41+
- target: x86_64-pc-windows-msvc
42+
os: windows-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
# 安装交叉编译工具链: https://github.com/taiki-e/setup-cross-toolchain-action
47+
# 如果安装 target 对应的工具链, 则下一步不会再安装并调用 cross 创建容器来编译, 可大幅缩短构建时间
48+
- name: Install cross-compilation tools
49+
continue-on-error: true
50+
uses: taiki-e/setup-cross-toolchain-action@v1
51+
with:
52+
target: ${{ matrix.target }}
53+
54+
# 构建并发布 Rust 程序: https://github.com/taiki-e/upload-rust-binary-action
55+
- uses: taiki-e/upload-rust-binary-action@v1
56+
with:
57+
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
58+
bin: ${{ github.event.repository.name }}
59+
# (optional) Target triple, default is host triple.
60+
target: ${{ matrix.target }}
61+
# (optional) Tool to build binaries (cargo, cross, or cargo-zigbuild)
62+
# build-tool: cargo-zigbuild # 使用 zig 作为链接器编译 Cargo 项目, 以便于交叉编译, 仅 Linux 平台支持性较好
63+
# (optional) Archive name (non-extension portion of filename) to be uploaded.
64+
# When multiple binary names are specified, default archive name or $bin variable cannot be used.
65+
archive: ${{ github.event.repository.name }}-$tag-$target
66+
# (optional) On which platform to distribute the `.tar.gz` file.
67+
tar: unix
68+
# (optional) On which platform to distribute the `.zip` file.
69+
zip: windows
70+
# (required) GitHub token for uploading assets to GitHub Releases.
71+
token: ${{ secrets.GITHUB_TOKEN }}
72+
73+
permissions:
74+
contents: write

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

.gitmodules

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[submodule "cmds/limit"]
2+
path = cmds/limit
3+
url = [email protected]:rust-net/limit.git
4+
branch = use
5+
[submodule "cmds/remote-bind"]
6+
path = cmds/remote-bind
7+
url = [email protected]:rust-net/remote-bind.git
8+
branch = use

0 commit comments

Comments
 (0)