From 3abf4471f0e530e04622caf8cc132aad3ebb6677 Mon Sep 17 00:00:00 2001 From: Mehran Davoudi Date: Mon, 25 Dec 2023 00:30:48 +0330 Subject: [PATCH 1/4] Create build.yml --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f51c38b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + SOLUTION_PATH: 'src/skUnit.sln' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore ${{ env.SOLUTION_PATH }} + - name: Build + run: dotnet build ${{ env.SOLUTION_PATH }} --no-restore +# - name: Test +# run: dotnet test ${{ env.SOLUTION_PATH }} --filter GitHubActions!=Skip --no-build --verbosity normal From 05ab9e713295df74a632bd1f5605b39b1d096cbf Mon Sep 17 00:00:00 2001 From: Mehran Davoudi Date: Mon, 25 Dec 2023 00:32:38 +0330 Subject: [PATCH 2/4] Create publish-nuget.ym --- .github/workflows/publish-nuget.ym | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/publish-nuget.ym diff --git a/.github/workflows/publish-nuget.ym b/.github/workflows/publish-nuget.ym new file mode 100644 index 0000000..939a75a --- /dev/null +++ b/.github/workflows/publish-nuget.ym @@ -0,0 +1,43 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Publish to Nuget + +on: + push: + tags: + - 'v*' + +env: + PROJECT_PATH: 'src/SemanticValidation/skUnit.csproj' + TEST_PATH: 'src/SemanticValidation.Test/skUnit.Test.csproj' + PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output + NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore ${{ env.PROJECT_PATH }} + - name: Build + run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release +# - name: Test +# run: dotnet test ${{ env.TEST_PATH }} --filter GitHubActions!=Skip --no-build --verbosity normal + + - name: 'Get Version' + id: version + uses: battila7/get-version-action@v2 + + - name: 'Pack project' + run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} + + - name: 'Push package' + run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_SOURCE_URL }} From 73e48f3861595db18536e6466c6bdba949ffaf8d Mon Sep 17 00:00:00 2001 From: Mehran Davoudi Date: Mon, 25 Dec 2023 00:35:25 +0330 Subject: [PATCH 3/4] Create publish-nuget.yml --- .github/workflows/publish-nuget.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/publish-nuget.yml diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 0000000..0a6e5ca --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,43 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Publish to Nuget + +on: + push: + tags: + - 'v*' + +env: + PROJECT_PATH: 'src/skUnit/skUnit.csproj' + TEST_PATH: 'src/skUnit.Test/skUnit.Test.csproj' + PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output + NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore ${{ env.PROJECT_PATH }} + - name: Build + run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release +# - name: Test +# run: dotnet test ${{ env.TEST_PATH }} --filter GitHubActions!=Skip --no-build --verbosity normal + + - name: 'Get Version' + id: version + uses: battila7/get-version-action@v2 + + - name: 'Pack project' + run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} + + - name: 'Push package' + run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_SOURCE_URL }} From d11d92b7e9f67251c9c5cf3f9ca8607f65f7cd8e Mon Sep 17 00:00:00 2001 From: Mehran Davoudi Date: Mon, 25 Dec 2023 00:36:04 +0330 Subject: [PATCH 4/4] Delete .github/workflows/publish-nuget.ym --- .github/workflows/publish-nuget.ym | 43 ------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 .github/workflows/publish-nuget.ym diff --git a/.github/workflows/publish-nuget.ym b/.github/workflows/publish-nuget.ym deleted file mode 100644 index 939a75a..0000000 --- a/.github/workflows/publish-nuget.ym +++ /dev/null @@ -1,43 +0,0 @@ -# This workflow will build a .NET project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net - -name: Publish to Nuget - -on: - push: - tags: - - 'v*' - -env: - PROJECT_PATH: 'src/SemanticValidation/skUnit.csproj' - TEST_PATH: 'src/SemanticValidation.Test/skUnit.Test.csproj' - PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output - NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json' - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 8.0.x - - name: Restore dependencies - run: dotnet restore ${{ env.PROJECT_PATH }} - - name: Build - run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release -# - name: Test -# run: dotnet test ${{ env.TEST_PATH }} --filter GitHubActions!=Skip --no-build --verbosity normal - - - name: 'Get Version' - id: version - uses: battila7/get-version-action@v2 - - - name: 'Pack project' - run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} - - - name: 'Push package' - run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_SOURCE_URL }}