From 59958362d84266927c9c82df4f8fe161f6f37aca Mon Sep 17 00:00:00 2001 From: Guilherme Martin <gsilvamartin@gmail.com> Date: Wed, 28 Feb 2024 22:55:31 -0300 Subject: [PATCH 1/2] Add of nuspec algorithm root project --- .../NetPlus.Algorithms.nuspec | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/NetPlus.Algorithms/NetPlus.Algorithms.nuspec diff --git a/src/NetPlus.Algorithms/NetPlus.Algorithms.nuspec b/src/NetPlus.Algorithms/NetPlus.Algorithms.nuspec new file mode 100644 index 0000000..819461b --- /dev/null +++ b/src/NetPlus.Algorithms/NetPlus.Algorithms.nuspec @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<package> + <metadata> + <id>NetPlus.Algorithms</id> + <version>1.0.0</version> + <title>NetPlus - Algorithms</title> + <authors>Guilherme Martin</authors> + <owners>Guilherme Martin</owners> + <description>NetPlus modules containing common algorithms</description> + </metadata> + <files> + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Comparison\bin\Release\netstandard2.0\*.dll" target="lib\netstandard2.0" /> + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Comparison\bin\Release\netstandard2.1\*.dll" target="lib\netstandard2.1" /> + + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Sorting\bin\Release\netstandard2.0\*.dll" target="lib\netstandard2.0" /> + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Sorting\bin\Release\netstandard2.1\*.dll" target="lib\netstandard2.1" /> + + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Search\bin\Release\netstandard2.0\*.dll" target="lib\netstandard2.0" /> + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Search\bin\Release\netstandard2.1\*.dll" target="lib\netstandard2.1" /> + + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Graphs\bin\Release\netstandard2.0\*.dll" target="lib\netstandard2.0" /> + <file src="src\NetPlus.Algorithms\NetPlus.Algorithms.Graphs\bin\Release\netstandard2.1\*.dll" target="lib\netstandard2.1" /> + </files> +</package> \ No newline at end of file From 3a3ae03913b8e1a9a6ad23160b2ca669d50b8dbb Mon Sep 17 00:00:00 2001 From: Guilherme Martin <gsilvamartin@gmail.com> Date: Wed, 28 Feb 2024 23:01:36 -0300 Subject: [PATCH 2/2] Create deploy-algorithms.yml --- .github/workflows/deploy-algorithms.yml | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/deploy-algorithms.yml diff --git a/.github/workflows/deploy-algorithms.yml b/.github/workflows/deploy-algorithms.yml new file mode 100644 index 0000000..4a5e436 --- /dev/null +++ b/.github/workflows/deploy-algorithms.yml @@ -0,0 +1,45 @@ +name: Publish - NetPlus.Algorithms + +on: + release: + types: + - created + branches: + - 'release/*' + +jobs: + build-and-push-algorithms: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '8.0' + + - name: Install nuget CLI + run: | + sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + alias nuget="mono /usr/local/bin/nuget.exe" + + - name: Get tag name + id: get_tag + run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV + + - name: Build Project and Pack NuGet package + run: | + dotnet build src/NetPlus.Algorithms/NetPlus.Algorithms.Graphs/*.csproj --configuration Release + dotnet build src/NetPlus.Algorithms/NetPlus.Algorithms.Comparison/*.csproj --configuration Release + dotnet build src/NetPlus.Algorithms/NetPlus.Algorithms.Search/*.csproj --configuration Release + dotnet build src/NetPlus.Algorithms/NetPlus.Algorithms.Sorting/*.csproj --configuration Release + dotnet pack src/NetPlus.Algorithms/*.nuspec -p $TAG_NAME + + - name: Push NuGet Package + run: | + nupkg_path="*/*.nupkg" + nuget push $nupkg_path -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }} + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}