chore: delivery nuget to fromdoppler github packages #118
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
name: .NET | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
continuous-delivery: | |
name: Continuous Delivery | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration Release | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Determine Version | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Semantic Version | |
run: | | |
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}" | |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}" | |
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}" | |
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" | |
echo "Major: ${{ steps.gitversion.outputs.major }}" | |
echo "Minor: ${{ steps.gitversion.outputs.minor }}" | |
echo "Patch: ${{ steps.gitversion.outputs.patch }}" | |
echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}" | |
- name: Pack nuget | |
run: dotnet pack --output ./artifacts -p:Version=${{ steps.gitversion.outputs.nuGetVersion }} | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: artifacts | |
path: ./artifacts | |
- name: Delivery nuget to Github Packages | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source 'https://nuget.pkg.github.com/FromDoppler/index.json' |