Skip to content

Commit

Permalink
Publish NuGet and create release in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
damirarh committed Sep 15, 2024
1 parent ac895a3 commit a860bc0
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/ClockifyExport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
tags:
- v*
pull_request:
branches:
- main
Expand Down Expand Up @@ -81,3 +79,26 @@ jobs:
conclusion: ${{ job.status }}
output: '{"summary":"Code coverage"}'
output_text_description_file: coverage/Summary.md

- name: Check for tag in current commit
id: check_tag
uses: digital-ai/query-tag-action@v2
with:
include: 'v*'
exact-match: true

- name: Create NuGet package
if: steps.check_tag.outputs.tag != 'NO_TAGS'
run: dotnet pack --configuration Release --no-build

- name: Publish NuGet package
if: steps.check_tag.outputs.tag != 'NO_TAGS'
run: dotnet nuget push nupkg\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org

- name: Create GitHub release
if: steps.check_tag.outputs.tag != 'NO_TAGS'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.check_tag.outputs.tag }}
prerelease: ${{ contains(steps.check_tag.outputs.tag, '-') && '--prerelease' || '' }}
run: gh release create "$tag" nupkg\*.nupkg --generate-notes $prelease

0 comments on commit a860bc0

Please sign in to comment.