-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c158f92
commit 62fa259
Showing
1 changed file
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,11 @@ env: | |
DOTNET_VERSION: 6.0.x | ||
NUGET_VERSION: 5.x | ||
BUILD_CONFIG: Release | ||
BUILD_TARGET: netstandard2.0 | ||
BUILD_PLATFORM: Any CPU | ||
PACK_PARAMETERS: '' | ||
NUGET_OUTPUT_FOLDER: nupkgs | ||
PRIMARY_BRANCH: refs/heads/main | ||
|
||
on: | ||
push: | ||
|
@@ -42,7 +44,7 @@ jobs: | |
branch='${{ github.ref }}' | ||
package_suffix='' | ||
if [ "$branch" != "refs/heads/main" ] | ||
if [ "$branch" != "${{ env.PRIMARY_BRANCH }}" ] | ||
then | ||
package_suffix='-beta' | ||
fi | ||
|
@@ -57,7 +59,7 @@ jobs: | |
if [ "${{ github.event_name }}" == "pull_request" ] | ||
then | ||
should_publish=true | ||
elif [ "${{ github.ref }}" == 'refs/heads/main' ] | ||
elif [ "${{ github.ref }}" == '${{ env.PRIMARY_BRANCH }}' ] | ||
then | ||
should_publish=true | ||
fi | ||
|
@@ -83,7 +85,7 @@ jobs: | |
should_publish: ${{ env.should_publish }} | ||
|
||
########################################################## | ||
## Bulid DotNet projects | ||
## Build DotNet projects | ||
build: | ||
name: Build .NET | ||
|
||
|
@@ -104,10 +106,10 @@ jobs: | |
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration ${{ env.BUILD_CONFIG }} /p:"Platform=${{ env.BUILD_PLATFORM }}" /p:"Version=${{ needs.setup.outputs.product_version }}" /p:"AssemblyVersion=${{ needs.setup.outputs.assembly_version }}" --no-restore | ||
run: dotnet build --no-restore --configuration ${{ env.BUILD_CONFIG }} --framework ${{ env.BUILD_TARGET }} /p:"Platform=${{ env.BUILD_PLATFORM }}" /p:"Version=${{ needs.setup.outputs.product_version }}" /p:"AssemblyVersion=${{ needs.setup.outputs.assembly_version }}" | ||
|
||
- name: Test | ||
run: dotnet test --configuration ${{ env.BUILD_CONFIG }} --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage" | ||
run: dotnet test --no-restore --no-build --configuration ${{ env.BUILD_CONFIG }} --verbosity normal --collect:"XPlat Code Coverage" | ||
|
||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
|
@@ -150,9 +152,11 @@ jobs: | |
## Generate a Release and Tag in git | ||
release: | ||
name: Create GitHub Release | ||
if: github.ref == 'refs/heads/main' && success() | ||
if: github.ref == '${{ env.PRIMARY_BRANCH }}' && success() | ||
|
||
needs: [setup, build] | ||
needs: | ||
- setup | ||
- build | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -172,6 +176,7 @@ jobs: | |
tag: v${{ needs.setup.outputs.assembly_version }} | ||
name: Release ${{ needs.setup.outputs.assembly_version }} | ||
body: ${{ steps.build_changelog.outputs.changelog }} | ||
artifacts: **/*.nupkg | ||
|
||
- name: Tag git | ||
uses: pkgdeps/[email protected] | ||
|
@@ -188,7 +193,10 @@ jobs: | |
name: Publish to NuGet | ||
if: needs.setup.outputs.should_publish == 'true' | ||
|
||
needs: [setup, build, release] | ||
needs: | ||
- setup | ||
- build | ||
- release | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|