From 64930965353c38457d19ba6f82a646492e0728dd Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 4 Mar 2025 14:59:04 +0800 Subject: [PATCH 1/8] Add GitHub Action --- .github/workflows/dotnet.yml | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..0a324ff --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,59 @@ +name: .NET Core Desktop + +on: + workflow_dispatch: + push: + branches: [ "main" ] + pull_request: + +jobs: + + build: + + runs-on: windows-latest + + env: + Dotnet_Version: 8.0.x + Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj + NuGet_Source: 'https://api.nuget.org/v3/index.json' + + steps: + + # Checkout codes + - name: Checkout + uses: actions/checkout@v4 + + # Install the .NET Core workload + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.Dotnet_Version }} + + # Restore dependencies + - name: Restore dependencies + run: dotnet restore ${{ env.Project_Path }} + + # Build the project + - name: Build + run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore + + # Execute all unit tests in the solution + - name: Execute unit tests + run: dotnet test --configuration Release --no-build + + # Pack the NuGet package + - name: Create NuGet package + run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --no-build --output nupkgs + + # Upload the NuGet package + - name: Upload NuGet package + uses: actions/upload-artifact@v4 + with: + name: Full nupkg + path: nupkgs\Flow.Launcher.Localization.*.nupkg + compression-level: 0 + + # Publish to NuGet.org + # - name: Publish to NuGet + # if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Only publish on push to main + # run: dotnet nuget push ./nupkgs/*.nupkg --source ${{ env.NuGet_Source }} --api-key ${{ secrets.NUGET_API_KEY }} From f54111b404590991c01fcbdb4312714faf79923b Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 4 Mar 2025 17:34:36 +0800 Subject: [PATCH 2/8] Update GitHub Action --- .github/workflows/dotnet.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0a324ff..8544366 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -50,10 +50,10 @@ jobs: uses: actions/upload-artifact@v4 with: name: Full nupkg - path: nupkgs\Flow.Launcher.Localization.*.nupkg + path: nupkgs/Flow.Launcher.Localization.*.nupkg compression-level: 0 # Publish to NuGet.org - # - name: Publish to NuGet - # if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Only publish on push to main - # run: dotnet nuget push ./nupkgs/*.nupkg --source ${{ env.NuGet_Source }} --api-key ${{ secrets.NUGET_API_KEY }} + - name: Push to NuGet + if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Only publish on push to main + run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.NuGet_Source }} From 7a3dd618517fd23e3490c814122cf6e2b878d3cc Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 4 Mar 2025 17:39:01 +0800 Subject: [PATCH 3/8] Update GitHub Action --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8544366..fe95ec5 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -43,7 +43,7 @@ jobs: # Pack the NuGet package - name: Create NuGet package - run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --no-build --output nupkgs + run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs # Upload the NuGet package - name: Upload NuGet package From 40bc9c8cda192bf415957dc1c958981bcaa7867a Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 4 Mar 2025 18:27:00 +0800 Subject: [PATCH 4/8] Fix NuGet publish issue & Add GitHub releases action --- .github/workflows/dotnet.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fe95ec5..246c96e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -15,7 +15,6 @@ jobs: env: Dotnet_Version: 8.0.x Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj - NuGet_Source: 'https://api.nuget.org/v3/index.json' steps: @@ -55,5 +54,20 @@ jobs: # Publish to NuGet.org - name: Push to NuGet - if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Only publish on push to main - run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.NuGet_Source }} + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }} + + # Get package version + - name: Get Package Version + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + $version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\netstandard2.0\Flow.Launcher.Localization.dll").productversion + echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append + + # Publish to GitHub releases + - name: Publish GitHub releases + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: softprops/action-gh-release@v1 + with: + files: "nupkgs\\*.nupkg" + tag_name: "v${{ env.release_version }}" From f64036beae839d824c07c3bd0eef022291cfe8dd Mon Sep 17 00:00:00 2001 From: Jack Ye <1160210343@qq.com> Date: Tue, 4 Mar 2025 18:31:42 +0800 Subject: [PATCH 5/8] Update .github/workflows/dotnet.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 246c96e..c39e5a0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -67,7 +67,7 @@ jobs: # Publish to GitHub releases - name: Publish GitHub releases if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v1.2.2 with: files: "nupkgs\\*.nupkg" tag_name: "v${{ env.release_version }}" From 37bb060ce8a9d357cb6847f52359f104fe0f9d3c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 4 Mar 2025 18:35:19 +0800 Subject: [PATCH 6/8] Revert "Update .github/workflows/dotnet.yml" This reverts commit f64036beae839d824c07c3bd0eef022291cfe8dd. --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c39e5a0..246c96e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -67,7 +67,7 @@ jobs: # Publish to GitHub releases - name: Publish GitHub releases if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: softprops/action-gh-release@v1.2.2 + uses: softprops/action-gh-release@v1 with: files: "nupkgs\\*.nupkg" tag_name: "v${{ env.release_version }}" From 6060850acfec4a3dbf0e8b6394317b14c6ebadb4 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Wed, 5 Mar 2025 21:09:41 +1100 Subject: [PATCH 7/8] separate workflows and change version to 0.0.1 --- .github/workflows/build.yml | 54 +++++++ .github/workflows/{dotnet.yml => publish.yml} | 136 ++++++++---------- ...low.Launcher.Localization.Analyzers.csproj | 2 +- ...ncher.Localization.SourceGenerators.csproj | 2 +- 4 files changed, 119 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{dotnet.yml => publish.yml} (62%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d23ee42 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,54 @@ +name: build + +on: + workflow_dispatch: + push: + branches: [ "main" ] + pull_request: + +jobs: + + build: + + runs-on: windows-latest + + env: + Dotnet_Version: 8.0.x + Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj + + steps: + + # Checkout codes + - name: Checkout + uses: actions/checkout@v4 + + # Install the .NET Core workload + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.Dotnet_Version }} + + # Restore dependencies + - name: Restore dependencies + run: dotnet restore ${{ env.Project_Path }} + + # Build the project + - name: Build + run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore + + # Execute all unit tests in the solution + - name: Execute unit tests + if: github.event_name == 'push' && github.ref != 'refs/heads/main' + run: dotnet test --configuration Release --no-build + + # Pack the NuGet package + - name: Create NuGet package + run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs + + # Upload the NuGet package + - name: Upload NuGet package + uses: actions/upload-artifact@v4 + with: + name: Full nupkg + path: nupkgs/Flow.Launcher.Localization.*.nupkg + compression-level: 0 diff --git a/.github/workflows/dotnet.yml b/.github/workflows/publish.yml similarity index 62% rename from .github/workflows/dotnet.yml rename to .github/workflows/publish.yml index 246c96e..49adb06 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/publish.yml @@ -1,73 +1,63 @@ -name: .NET Core Desktop - -on: - workflow_dispatch: - push: - branches: [ "main" ] - pull_request: - -jobs: - - build: - - runs-on: windows-latest - - env: - Dotnet_Version: 8.0.x - Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj - - steps: - - # Checkout codes - - name: Checkout - uses: actions/checkout@v4 - - # Install the .NET Core workload - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.Dotnet_Version }} - - # Restore dependencies - - name: Restore dependencies - run: dotnet restore ${{ env.Project_Path }} - - # Build the project - - name: Build - run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore - - # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test --configuration Release --no-build - - # Pack the NuGet package - - name: Create NuGet package - run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs - - # Upload the NuGet package - - name: Upload NuGet package - uses: actions/upload-artifact@v4 - with: - name: Full nupkg - path: nupkgs/Flow.Launcher.Localization.*.nupkg - compression-level: 0 - - # Publish to NuGet.org - - name: Push to NuGet - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }} - - # Get package version - - name: Get Package Version - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: | - $version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\netstandard2.0\Flow.Launcher.Localization.dll").productversion - echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append - - # Publish to GitHub releases - - name: Publish GitHub releases - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: softprops/action-gh-release@v1 - with: - files: "nupkgs\\*.nupkg" - tag_name: "v${{ env.release_version }}" +name: build + +on: + workflow_dispatch: + push: + branches: + - main + tags: + - '*' + +jobs: + + build: + + runs-on: windows-latest + + env: + Dotnet_Version: 8.0.x + Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj + + steps: + + # Checkout codes + - name: Checkout + uses: actions/checkout@v4 + + # Install the .NET Core workload + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.Dotnet_Version }} + + # Restore dependencies + - name: Restore dependencies + run: dotnet restore ${{ env.Project_Path }} + + # Build the project + - name: Build + run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore + + # Pack the NuGet package + - name: Create NuGet package + run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs + + # # Publish to NuGet.org + # - name: Push to NuGet + # if: github.event_name == 'push' && github.ref == 'refs/heads/main' + # run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }} + + # Get package version + - name: Get Package Version + # if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + $version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\netstandard2.0\Flow.Launcher.Localization.dll").productversion + echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append + + # Publish to GitHub releases + - name: Publish GitHub releases + # if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: softprops/action-gh-release@v1 + with: + files: "nupkgs\\*.nupkg" + tag_name: "v${{ env.release_version }}" diff --git a/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj b/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj index fb94749..860184b 100644 --- a/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj +++ b/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj @@ -1,7 +1,7 @@ - 1.0.0 + 0.0.1 netstandard2.0 true Flow.Launcher.Localization.Analyzers diff --git a/Flow.Launcher.Localization.SourceGenerators/Flow.Launcher.Localization.SourceGenerators.csproj b/Flow.Launcher.Localization.SourceGenerators/Flow.Launcher.Localization.SourceGenerators.csproj index f8b7ab7..98bf6ef 100644 --- a/Flow.Launcher.Localization.SourceGenerators/Flow.Launcher.Localization.SourceGenerators.csproj +++ b/Flow.Launcher.Localization.SourceGenerators/Flow.Launcher.Localization.SourceGenerators.csproj @@ -1,7 +1,7 @@  - 1.0.0 + 0.0.1 netstandard2.0 true Flow.Launcher.Localization.SourceGenerators From 71b34d6b109616fde0e3fa7d2df3257035aa2ac3 Mon Sep 17 00:00:00 2001 From: Jack Ye <1160210343@qq.com> Date: Wed, 5 Mar 2025 18:13:21 +0800 Subject: [PATCH 8/8] Update Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj Co-authored-by: Jeremy Wu --- .../Flow.Launcher.Localization.Analyzers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj b/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj index 26af6ae..27ac90a 100644 --- a/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj +++ b/Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.csproj @@ -1,6 +1,6 @@ - + 1.0.0 netstandard2.0 true