Skip to content

Commit

Permalink
Merge pull request #10 from hootanht/fix-cd-error-1
Browse files Browse the repository at this point in the history
Fix CD error
  • Loading branch information
hootanht authored Sep 12, 2024
2 parents 57660e8 + 8a13853 commit 955e08b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ jobs:
git tag -d "v${{ steps.get_version.outputs.version }}"
git push --delete origin "v${{ steps.get_version.outputs.version }}"
fi
continue-on-error: true

- name: Check if tag deletion was successful
id: check_tag_deletion
run: |
if git rev-parse "v${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then
echo "Tag deletion failed"
exit 1
else
echo "Tag deletion successful"
fi
- name: Create GitHub release
id: create_release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The CI pipeline is defined in `.github/workflows/ci.yml` and uses `macos-latest`

## CD Pipeline

The CD pipeline is defined in `.github/workflows/cd.yml` and uses `macos-latest` as the VM image. It restores NuGet packages, builds the solution, runs tests, and publishes the NuGet package. The pipeline installs .NET version 8.0.x to ensure compatibility with all targeted frameworks. Additionally, it includes a step to delete existing tags if they already exist before creating a new release to avoid the 'Validation Failed: already_exists' error.
The CD pipeline is defined in `.github/workflows/cd.yml` and uses `macos-latest` as the VM image. It restores NuGet packages, builds the solution, runs tests, and publishes the NuGet package. The pipeline installs .NET version 8.0.x to ensure compatibility with all targeted frameworks. Additionally, it includes a step to delete existing tags if they already exist before creating a new release to avoid the 'Validation Failed: already_exists' error. The step now handles the case where the tag deletion fails and ensures the deletion step successfully removes the existing tag before proceeding to create a new release.

## Developer [![Twitter Follow](https://img.shields.io/twitter/follow/hootanht?style=social)](https://twitter.com/hootanht)

Expand Down

0 comments on commit 955e08b

Please sign in to comment.