Skip to content

Commit

Permalink
Update workflow actions for build/release/publish
Browse files Browse the repository at this point in the history
  • Loading branch information
delatrie committed Mar 26, 2024
1 parent 2220eaf commit 461ba07
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
26 changes: 19 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down

0 comments on commit 461ba07

Please sign in to comment.