Skip to content

Commit

Permalink
Merge pull request #6 from TitanShark/feature/init
Browse files Browse the repository at this point in the history
#1 | FIXED: Publishing and Tagging.
  • Loading branch information
lanluu authored Dec 13, 2020
2 parents 9987860 + c132f10 commit 4e66c66
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,36 @@ jobs:

# See also: https://github.com/actions/virtual-environments/issues/1891
- uses: actions/setup-dotnet@v1
name: Setup dotnet
name: Setup DotNet CLI 5.0.x
with:
dotnet-version: 5.0.x

- name: Calculate Version
- name: Build and Run Tests
shell: bash
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
run: |
# Installs Minver-CLI
dotnet tool install -g minver-cli --version 2.3.1
dotnet build --configuration Release
dotnet test ./**/bin/**/net*/*Tests.dll
- name: Pack and Publish to Nuget
shell: bash
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
run: |
dotnet pack
dotnet nuget push ./**/bin/**/*.nupkg --api-key $NUGET_KEY --source https://api.nuget.org/v3/index.json
# Gets the version number
MINVER_VERSION=$(minver --auto-increment patch --tag-prefix v --verbosity t)
# See also: https://itnext.io/creating-a-github-action-to-tag-commits-2722f1560dec
- name: Add Git-Tag corresponding Current SEMVER-Version
shell: bash
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
run: |
dotnet tool install -g minver-cli --version 2.3.1
version=$(minver --auto-increment patch --tag-prefix v --verbosity t)
tag="v${version}"
git tag $tag
git push origin $tag
# See also: https://github.com/marketplace/actions/publish-nuget
- uses: rohith/publish-nuget@v2
name: Build and publish Nuget-Package 'TitanShark.Thresher.Core'
with:
PROJECT_FILE_PATH: TitanShark.Thresher.Core/TitanShark.Thresher.Core.csproj
PACKAGE_NAME: TitanShark.Thresher.Core
VERSION_STATIC: ${{env.MINVER_VERSION}}
TAG_COMMIT: true
TAG_FORMAT: v*
NUGET_SOURCE: https://api.nuget.org
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: false

0 comments on commit 4e66c66

Please sign in to comment.