From c02e2b63e90a0e6b838c1a85076f59f050aadbfb Mon Sep 17 00:00:00 2001 From: Alex Zaytsev <hazzik@gmail.com> Date: Thu, 25 Aug 2022 20:41:26 +1200 Subject: [PATCH 1/6] Automatically generate async code on pull requests (#3133) (cherry picked from commit 2e2492561c5a6a2ba95e4ba50269feb9453e712c) --- .github/workflows/GenerateAsyncCode.yml | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/GenerateAsyncCode.yml diff --git a/.github/workflows/GenerateAsyncCode.yml b/.github/workflows/GenerateAsyncCode.yml new file mode 100644 index 00000000000..84f474ec756 --- /dev/null +++ b/.github/workflows/GenerateAsyncCode.yml @@ -0,0 +1,44 @@ +name: Generate Async code + +on: + pull_request_target: + paths: + - '**.cs' + +permissions: {} + +jobs: + generate-async: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + token: ${{ secrets.NHIBERNATE_BOT_TOKEN }} + + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Generate Async code + run: | + pushd src + dotnet tool restore + dotnet restore ./NHibernate.sln + dotnet async-generator + popd + + - name: Push changes + run: | + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + if [[ -z "$(git status --porcelain)" ]]; then + echo "No changes to commit" + exit 0 + fi + git add -A + git commit -am "Generate async files" + git push From 4e1c7fabcd1fc0b661cd4a9fd9ad15df4daab19b Mon Sep 17 00:00:00 2001 From: Roman Artiukhin <bahusdrive@gmail.com> Date: Mon, 16 Jan 2023 19:39:59 +0200 Subject: [PATCH 2/6] 5.3 Adjustments --- .github/workflows/GenerateAsyncCode.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/GenerateAsyncCode.yml b/.github/workflows/GenerateAsyncCode.yml index 84f474ec756..dd2badb26c4 100644 --- a/.github/workflows/GenerateAsyncCode.yml +++ b/.github/workflows/GenerateAsyncCode.yml @@ -19,16 +19,16 @@ jobs: token: ${{ secrets.NHIBERNATE_BOT_TOKEN }} - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 2.2.x - name: Generate Async code run: | + dotnet restore "./Tools/packages.csproj" --packages ./Tools pushd src - dotnet tool restore dotnet restore ./NHibernate.sln - dotnet async-generator + dotnet $(find ./../Tools/csharpasyncgenerator.commandline -name AsyncGenerator.CommandLine.dll) popd - name: Push changes From 7058651fc2d8b5d6869d8aa7a15a076f7594a00e Mon Sep 17 00:00:00 2001 From: Roman Artiukhin <bahusdrive@gmail.com> Date: Mon, 16 Jan 2023 20:05:04 +0200 Subject: [PATCH 3/6] test --- .github/workflows/GenerateAsyncCode.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/GenerateAsyncCode.yml b/.github/workflows/GenerateAsyncCode.yml index dd2badb26c4..afa534f0681 100644 --- a/.github/workflows/GenerateAsyncCode.yml +++ b/.github/workflows/GenerateAsyncCode.yml @@ -13,10 +13,6 @@ jobs: steps: - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - token: ${{ secrets.NHIBERNATE_BOT_TOKEN }} - name: Setup .NET uses: actions/setup-dotnet@v3 From 048e7c708b0ed9787d68703acd5e00799a97ada7 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin <bahusdrive@gmail.com> Date: Mon, 16 Jan 2023 20:15:43 +0200 Subject: [PATCH 4/6] Update Tools .gitignore --- Tools/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/.gitignore b/Tools/.gitignore index c98efa933bc..64a4b62db7a 100644 --- a/Tools/.gitignore +++ b/Tools/.gitignore @@ -4,3 +4,4 @@ csharpasyncgenerator.commandline/ gitreleasemanager/ obj/ microsoft.* +netstandard.library/ \ No newline at end of file From 71133ba943cbfcfeb5001e738412e04e6548abb9 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin <bahusdrive@gmail.com> Date: Mon, 16 Jan 2023 20:22:28 +0200 Subject: [PATCH 5/6] Revert "test" This reverts commit 7058651fc2d8b5d6869d8aa7a15a076f7594a00e. --- .github/workflows/GenerateAsyncCode.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/GenerateAsyncCode.yml b/.github/workflows/GenerateAsyncCode.yml index afa534f0681..dd2badb26c4 100644 --- a/.github/workflows/GenerateAsyncCode.yml +++ b/.github/workflows/GenerateAsyncCode.yml @@ -13,6 +13,10 @@ jobs: steps: - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + token: ${{ secrets.NHIBERNATE_BOT_TOKEN }} - name: Setup .NET uses: actions/setup-dotnet@v3 From 05b74ccd80bba386fbba992a5b32089aa9886914 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin <bahusdrive@gmail.com> Date: Tue, 17 Jan 2023 10:23:23 +0200 Subject: [PATCH 6/6] Update Tools/.gitignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Frédéric Delaporte <12201973+fredericDelaporte@users.noreply.github.com> --- Tools/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/.gitignore b/Tools/.gitignore index 64a4b62db7a..0d3d0093ed6 100644 --- a/Tools/.gitignore +++ b/Tools/.gitignore @@ -4,4 +4,4 @@ csharpasyncgenerator.commandline/ gitreleasemanager/ obj/ microsoft.* -netstandard.library/ \ No newline at end of file +netstandard.* \ No newline at end of file