From 461ba07fe63372214fc23cfbd149d1ab436d5dba Mon Sep 17 00:00:00 2001 From: Maksim Stepanov <17935127+delatrie@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:45:05 +0700 Subject: [PATCH] Update workflow actions for build/release/publish --- .github/workflows/build.yml | 32 ++++++++++++++++++++------------ .github/workflows/publish.yml | 26 +++++++++++++++++++------- .github/workflows/release.yml | 2 +- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e29341a2..e2efde11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,28 +16,36 @@ on: - 'main' - 'hotfix-*' -jobs: +jobs: build: name: "Build" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 - + - uses: actions/checkout@v4 + - name: 'Setup .NET Core SDK' - uses: actions/setup-dotnet@v3.2.0 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 3.1.x 6.0.x - 7.0.x - + - name: 'Restore packages' - run: dotnet restore ${{ env.SOLUTION_PATH }} --packages ${{ env.RESTORE_OUTPUT_PATH }} - + run: | + dotnet restore ${{ env.SOLUTION_PATH }}\ + --packages ${{ env.RESTORE_OUTPUT_PATH }} + - name: 'Build project using dotnet' - run: dotnet build ${{ env.SOLUTION_PATH }} --no-restore --configuration ${{ env.BUILD_CONFIGURATION }} - + run: | + dotnet build ${{ env.SOLUTION_PATH }}\ + --no-restore\ + --configuration ${{ env.BUILD_CONFIGURATION }} + - name: 'Run tests' run: | - dotnet test Allure.Net.Commons.Tests/Allure.Net.Commons.Tests.csproj --no-build --configuration ${{ env.BUILD_CONFIGURATION }} - dotnet test Allure.SpecFlowPlugin.Tests/Allure.SpecFlowPlugin.Tests.csproj --no-build --configuration ${{ env.BUILD_CONFIGURATION }} + dotnet test Allure.Net.Commons.Tests/Allure.Net.Commons.Tests.csproj\ + --no-build\ + --configuration ${{ env.BUILD_CONFIGURATION }} + dotnet test Allure.SpecFlowPlugin.Tests/Allure.SpecFlowPlugin.Tests.csproj\ + --no-build\ + --configuration ${{ env.BUILD_CONFIGURATION }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6d45885a..4bb68867 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,21 +14,26 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4 - name: 'Setup .NET Core SDK' - uses: actions/setup-dotnet@v3.2.0 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 3.1.x 6.0.x - 7.0.x - name: 'Restore packages' - run: dotnet restore ${{ env.SOLUTION_PATH }} --packages ${{ env.RESTORE_OUTPUT_PATH }} + run: | + dotnet restore ${{ env.SOLUTION_PATH }}\ + --packages ${{ env.RESTORE_OUTPUT_PATH }} - name: 'Build project using dotnet' - run: dotnet build ${{ env.SOLUTION_PATH }} --no-restore --configuration ${{ env.BUILD_CONFIGURATION }} -p:ContinuousIntegrationBuild=true + run: | + dotnet build ${{ env.SOLUTION_PATH }}\ + --no-restore\ + --configuration ${{ env.BUILD_CONFIGURATION }}\ + -p:ContinuousIntegrationBuild=true # Lower AspectInjector requirement for users of the packages to workaround #391 (build crash on macOS arm machines) - name: Reduce AspectInjector requirement to 2.8.1 @@ -37,10 +42,17 @@ jobs: dotnet add Allure.XUnit package AspectInjector --version 2.8.1 - name: 'Pack project' - run: dotnet pack ${{ env.SOLUTION_PATH }} --no-restore --no-build --configuration ${{ env.BUILD_CONFIGURATION }} -p:PackageOutputPath=${{ env.PACKAGE_OUTPUT_PATH }} + run: | + dotnet pack ${{ env.SOLUTION_PATH }}\ + --no-restore\ + --no-build\ + --configuration ${{ env.BUILD_CONFIGURATION }}\ + -p:PackageOutputPath=${{ env.PACKAGE_OUTPUT_PATH }} - name: 'NuGet publish' run: | - dotnet nuget push "*/${{ env.PACKAGE_OUTPUT_PATH }}/*.nupkg" -k ${NUGET_TOKEN} -s https://api.nuget.org/v3/index.json + dotnet nuget push "*/${{ env.PACKAGE_OUTPUT_PATH }}/*.nupkg"\ + -k ${NUGET_TOKEN}\ + -s https://api.nuget.org/v3/index.json env: NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70fa954a..259c3536 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: "Check next version" run: | expr "${{ inputs.nextVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' - - uses: actions/checkout@v3.0.2 + - uses: actions/checkout@v4 with: token: ${{ secrets.QAMETA_CI }}