Skip to content

Commit

Permalink
Update versioning in build and release actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyaulee committed Sep 16, 2022
1 parent 608cfb4 commit 504bd6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/JsBind.Net-Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ jobs:
version:
runs-on: ubuntu-latest
outputs:
SemVer: ${{ steps.gitversion.outputs.SemVer }}
FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}
NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -76,7 +75,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"JsBind.Net" /o:"mingyaulee" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /v:"v${{ needs.version.outputs.FullSemVer }}" /d:sonar.cs.vstest.reportsPaths="test/TestResults/*.trx" /d:sonar.cs.opencover.reportsPaths="test/TestResults/**/*.opencover.xml"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"JsBind.Net" /o:"mingyaulee" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /v:"v${{ needs.version.outputs.NuGetVersion }}" /d:sonar.cs.vstest.reportsPaths="test/TestResults/*.trx" /d:sonar.cs.opencover.reportsPaths="test/TestResults/**/*.opencover.xml"
dotnet build --no-restore --configuration Release
.\.coverlet\console\coverlet ./test/JsBind.Net.Tests/bin/Release/net7.0/wwwroot/_framework --include "[JsBind.Net*]*" --target "dotnet" --targetargs "test . --no-restore --no-build --configuration Release" --format opencover --output ./test/TestResults/coverage --verbosity detailed
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
Expand All @@ -91,12 +90,12 @@ jobs:
uses: mukunku/tag-exists-action@v1.0.0
id: tagExistsCheck
with:
tag: 'v${{ needs.version.outputs.SemVer }}'
tag: 'v${{ needs.version.outputs.NuGetVersion }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag
if: steps.tagExistsCheck.outputs.exists == 'false'
uses: negz/create-tag@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v${{ needs.version.outputs.SemVer }}
version: v${{ needs.version.outputs.NuGetVersion }}
4 changes: 2 additions & 2 deletions .github/workflows/JsBind.Net-Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Build
run: 'dotnet build --no-restore --configuration Release -p:"AssemblyVersion=${{ steps.gitversion.outputs.MajorMinorPatch }};Version=${{ steps.gitversion.outputs.SemVer }}"'
run: dotnet build --no-restore --configuration Release -p:Version=${{ steps.gitversion.outputs.NuGetVersion }}
- name: Pack
run: 'dotnet pack --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.gitversion.outputs.SemVer }}'
run: dotnet pack --no-restore --no-build --configuration Release -p:Version=${{ steps.gitversion.outputs.NuGetVersion }}
- name: Push generated package to NuGet
run: dotnet nuget push ./src/PackageOutput/*.nupkg --api-key ${NUGET_AUTH_TOKEN} --source https://api.nuget.org/v3/index.json
env:
Expand Down

0 comments on commit 504bd6f

Please sign in to comment.