From b837163c8478db6b650c7ac7a574f659acd1cccb Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Thu, 17 Apr 2025 14:20:49 +0000 Subject: [PATCH] temp --- .github/actions/rust-build/action.yml | 2 ++ .github/workflows/format.yml | 2 ++ .github/workflows/release-tmp.yml | 29 +++++++++++++++++++ .github/workflows/release.yml | 1 + .gitignore | 1 + CONTRIBUTING.md | 4 +-- .../CHANGELOG.md | 0 Cargo.lock => async-profiler-agent/Cargo.lock | 0 Cargo.toml => async-profiler-agent/Cargo.toml | 2 +- cliff.toml => async-profiler-agent/cliff.toml | 0 .../examples}/simple/main.rs | 0 .../examples}/simple/slow.rs | 0 .../release-plz.toml | 0 .../src}/asprof/mod.rs | 0 .../src}/asprof/raw.rs | 0 {src => async-profiler-agent/src}/lib.rs | 0 .../src}/metadata/aws.rs | 0 .../src}/metadata/mod.rs | 0 .../src}/pollcatch/mod.rs | 0 .../src}/pollcatch/tsc.rs | 0 {src => async-profiler-agent/src}/profiler.rs | 0 .../src}/reporter/mod.rs | 0 .../src}/reporter/s3.rs | 0 23 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release-tmp.yml rename CHANGELOG.md => async-profiler-agent/CHANGELOG.md (100%) rename Cargo.lock => async-profiler-agent/Cargo.lock (100%) rename Cargo.toml => async-profiler-agent/Cargo.toml (98%) rename cliff.toml => async-profiler-agent/cliff.toml (100%) rename {examples => async-profiler-agent/examples}/simple/main.rs (100%) rename {examples => async-profiler-agent/examples}/simple/slow.rs (100%) rename release-plz.toml => async-profiler-agent/release-plz.toml (100%) rename {src => async-profiler-agent/src}/asprof/mod.rs (100%) rename {src => async-profiler-agent/src}/asprof/raw.rs (100%) rename {src => async-profiler-agent/src}/lib.rs (100%) rename {src => async-profiler-agent/src}/metadata/aws.rs (100%) rename {src => async-profiler-agent/src}/metadata/mod.rs (100%) rename {src => async-profiler-agent/src}/pollcatch/mod.rs (100%) rename {src => async-profiler-agent/src}/pollcatch/tsc.rs (100%) rename {src => async-profiler-agent/src}/profiler.rs (100%) rename {src => async-profiler-agent/src}/reporter/mod.rs (100%) rename {src => async-profiler-agent/src}/reporter/s3.rs (100%) diff --git a/.github/actions/rust-build/action.yml b/.github/actions/rust-build/action.yml index a9a8f54..8283be8 100644 --- a/.github/actions/rust-build/action.yml +++ b/.github/actions/rust-build/action.yml @@ -16,7 +16,9 @@ runs: - uses: Swatinem/rust-cache@v2 - name: Build shell: bash + working-directory: async-profiler-agent run: if [ "${{ inputs.toolchain }}" != stable ]; then rm -fv Cargo.lock; fi && cargo build --all-features --verbose - name: Run tests shell: bash + working-directory: async-profiler-agent run: cargo test --all-features --verbose diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 2b404ec..7157a3c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -14,6 +14,7 @@ jobs: - name: Run fmt check id: cargoFmt shell: bash + working-directory: async-profiler-agent run: cargo fmt --all -- --check clippy: name: Cargo clippy @@ -25,4 +26,5 @@ jobs: - name: Run clippy check id: cargoClippy shell: bash + working-directory: async-profiler-agent run: cargo clippy --workspace --all-features -- -D warnings diff --git a/.github/workflows/release-tmp.yml b/.github/workflows/release-tmp.yml new file mode 100644 index 0000000..b44e668 --- /dev/null +++ b/.github/workflows/release-tmp.yml @@ -0,0 +1,29 @@ +name: Publish release + +permissions: + pull-requests: write + contents: write + +on: + pull_request: + +jobs: + release-plz-release: + if: github.repository_owner == 'async-profiler' + name: Release-plz release + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: release-plz/action@v0.5.102 + working-directory: async-profiler-agent + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2a266c..4a6edf9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,7 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Run release-plz uses: release-plz/action@v0.5.102 + working-directory: async-profiler-agent with: command: release env: diff --git a/.gitignore b/.gitignore index ea8c4bf..b8501c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/async-profiler-agent/target diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3cec6e5..93fe420 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,15 +50,13 @@ There is a `.github/workflows/release.yml` workflow that will attempt to use a c To update the `Cargo.toml` and changelog, use [conventional commits], and in a clean git repo, run the following commands: ``` cargo install release-plz -git checkout main && release-plz update && git commit -a +git checkout main && ( cd async-profiler-agent && release-plz update ) && git commit -a ``` Then make a new PR for the release and get it approved. The automated release PR generation functionality is not used here. -This requires a crates.io token in GitHub secrets for the repo. Currently the "token" is literally the string `secret` but I will put a more realistic token once the repo is public. - [conventional commits]: https://www.conventionalcommits.org/en/v1.0.0/ ## Code of Conduct diff --git a/CHANGELOG.md b/async-profiler-agent/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to async-profiler-agent/CHANGELOG.md diff --git a/Cargo.lock b/async-profiler-agent/Cargo.lock similarity index 100% rename from Cargo.lock rename to async-profiler-agent/Cargo.lock diff --git a/Cargo.toml b/async-profiler-agent/Cargo.toml similarity index 98% rename from Cargo.toml rename to async-profiler-agent/Cargo.toml index 0f7dc63..ff96fbd 100644 --- a/Cargo.toml +++ b/async-profiler-agent/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.1" description = "Rust agent for async-profiler" license = "Apache-2.0" repository = "https://github.com/async-profiler/rust-agent" -readme = "README.md" +readme = "../README.md" edition = "2021" [dependencies] diff --git a/cliff.toml b/async-profiler-agent/cliff.toml similarity index 100% rename from cliff.toml rename to async-profiler-agent/cliff.toml diff --git a/examples/simple/main.rs b/async-profiler-agent/examples/simple/main.rs similarity index 100% rename from examples/simple/main.rs rename to async-profiler-agent/examples/simple/main.rs diff --git a/examples/simple/slow.rs b/async-profiler-agent/examples/simple/slow.rs similarity index 100% rename from examples/simple/slow.rs rename to async-profiler-agent/examples/simple/slow.rs diff --git a/release-plz.toml b/async-profiler-agent/release-plz.toml similarity index 100% rename from release-plz.toml rename to async-profiler-agent/release-plz.toml diff --git a/src/asprof/mod.rs b/async-profiler-agent/src/asprof/mod.rs similarity index 100% rename from src/asprof/mod.rs rename to async-profiler-agent/src/asprof/mod.rs diff --git a/src/asprof/raw.rs b/async-profiler-agent/src/asprof/raw.rs similarity index 100% rename from src/asprof/raw.rs rename to async-profiler-agent/src/asprof/raw.rs diff --git a/src/lib.rs b/async-profiler-agent/src/lib.rs similarity index 100% rename from src/lib.rs rename to async-profiler-agent/src/lib.rs diff --git a/src/metadata/aws.rs b/async-profiler-agent/src/metadata/aws.rs similarity index 100% rename from src/metadata/aws.rs rename to async-profiler-agent/src/metadata/aws.rs diff --git a/src/metadata/mod.rs b/async-profiler-agent/src/metadata/mod.rs similarity index 100% rename from src/metadata/mod.rs rename to async-profiler-agent/src/metadata/mod.rs diff --git a/src/pollcatch/mod.rs b/async-profiler-agent/src/pollcatch/mod.rs similarity index 100% rename from src/pollcatch/mod.rs rename to async-profiler-agent/src/pollcatch/mod.rs diff --git a/src/pollcatch/tsc.rs b/async-profiler-agent/src/pollcatch/tsc.rs similarity index 100% rename from src/pollcatch/tsc.rs rename to async-profiler-agent/src/pollcatch/tsc.rs diff --git a/src/profiler.rs b/async-profiler-agent/src/profiler.rs similarity index 100% rename from src/profiler.rs rename to async-profiler-agent/src/profiler.rs diff --git a/src/reporter/mod.rs b/async-profiler-agent/src/reporter/mod.rs similarity index 100% rename from src/reporter/mod.rs rename to async-profiler-agent/src/reporter/mod.rs diff --git a/src/reporter/s3.rs b/async-profiler-agent/src/reporter/s3.rs similarity index 100% rename from src/reporter/s3.rs rename to async-profiler-agent/src/reporter/s3.rs