Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
Properly handled version tags
  • Loading branch information
neronotte authored Sep 2, 2024
1 parent 84bde3d commit 0fe7ddf
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,31 @@ jobs:
- name: Find NuGet package
id: find_package
run: echo "::set-output name=package::$(Get-ChildItem -Recurse -Filter *.nupkg | Select-Object -First 1).FullName"


- name: Check for tags
id: check_tags
run: |
if [ -z "$(git tag)" ]; then
echo "No tags found"
echo "::set-output name=has_tags::false"
else
echo "::set-output name=has_tags::true"
fi
- name: Get previous release tag
id: prev_tag
if: steps.check_tags.outputs.has_tags == 'true'
run: echo "::set-output name=tag::$(git describe --tags --abbrev=0 HEAD^)"

- name: Get commit messages
id: commit_messages
run: echo "::set-output name=messages::$(git log ${{ steps.prev_tag.outputs.tag }}..HEAD --pretty=format:'%s')"

run: |
if [ "${{ steps.check_tags.outputs.has_tags }}" == "true" ]; then
echo "::set-output name=messages::$(git log ${{ steps.prev_tag.outputs.tag }}..HEAD --pretty=format:'%s')"
else
echo "::set-output name=messages::$(git log --pretty=format:'%s')"
fi
- name: Create GitHub Release
uses: actions/create-release@v1
env:
Expand Down

0 comments on commit 0fe7ddf

Please sign in to comment.