-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Starry-OS/feat_pr
chore: add tools for commit patch
- Loading branch information
Showing
8 changed files
with
331 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# The directory of the main repo | ||
WORK_DIR=$1 | ||
|
||
PATCH_TOOL_DIR=$WORK_DIR/tools/patch_tool | ||
|
||
# The package which needs to be patched | ||
# It always be the package which triggers the test | ||
PATCH_PACKAGE=$2 | ||
|
||
# The URL of the patch points to | ||
PATCH_TARGET_URL=$3 | ||
|
||
# The commit hash of the patch | ||
PATCH_COMMIT_HASH=$4 | ||
|
||
# To run the main repo actions | ||
mkdir .github/workflows/actions | ||
mv $WORK_DIR/.github/workflows/actions/* .github/workflows/actions | ||
|
||
# To do the patch for current commit | ||
cd $PATCH_TOOL_DIR | ||
cargo run -- $WORK_DIR $PATCH_PACKAGE $PATCH_TARGET_URL $PATCH_COMMIT_HASH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[dependencies] | ||
anyhow = "1.0" | ||
toml = "0.8" | ||
|
||
[dependencies.serde] | ||
features = ["derive"] | ||
version = "1.0" | ||
|
||
[package] | ||
edition = "2021" | ||
name = "patch_tool" | ||
version = "0.1.0" | ||
|
||
[workspace] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
mod patch; | ||
#[macro_use] | ||
extern crate anyhow; | ||
fn main() { | ||
let args: Vec<String> = std::env::args().collect(); | ||
let cargo_path = &args[1]; | ||
let patch_name = &args[2]; | ||
// 默认服务端是 github,后续可能需要根据默认参数来传递 | ||
let patch_repo_name = &args[3]; | ||
let commit = &args[4]; | ||
patch::do_patch(cargo_path, patch_name, patch_repo_name, commit).unwrap(); | ||
} |
Oops, something went wrong.