Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
karimz1 committed Jan 12, 2025
1 parent 8ae0eeb commit efff378
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,24 @@ jobs:
- name: Build and pack
run: dotnet pack --configuration Release --output ./nupkg


- name: Debug NUGET_API_KEY
run: |
if [ -z "$NUGET_API_KEY" ]; then
echo "NUGET_API_KEY is empty."
exit 1
else
echo "NUGET_API_KEY is present."
fi
env:
NUGET_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}


- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
run: |
dotnet nuget push ./nupkg/*.nupkg \
--api-key "$NUGET_API_KEY" \
--source "https://api.nuget.org/v3/index.json"
29 changes: 19 additions & 10 deletions retag.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
#!/bin/bash

TAG="${1:-v1.0.0}"
# Ensure two arguments are provided (OLD_TAG and NEW_TAG).
if [ $# -lt 2 ]; then
echo "Error: Missing arguments."
echo "Usage: $0 <OLD_TAG> <NEW_TAG>"
echo "Example: ./retag.sh v1.1.0 v1.1.0" to replace the tag!
exit 1
fi

echo "Removing local tag: $TAG"
git tag -d "$TAG" 2>/dev/null
OLD_TAG="$1"
NEW_TAG="$2"

echo "Removing remote tag: $TAG"
git push origin ":refs/tags/$TAG"
echo "Removing old local tag (if exists): $OLD_TAG"
git tag -d "$OLD_TAG" 2>/dev/null

echo "Creating local tag: $TAG"
git tag "$TAG"
echo "Removing old remote tag (if exists): $OLD_TAG"
git push origin ":refs/tags/$OLD_TAG" 2>/dev/null

echo "Pushing tag: $TAG"
git push origin "$TAG"
echo "Creating new local tag: $NEW_TAG"
git tag "$NEW_TAG"

echo "Done! The tag '$TAG' has been recreated and pushed."
echo "Pushing new tag to remote: $NEW_TAG"
git push origin "$NEW_TAG"

echo "Done! '$OLD_TAG' (if it existed) was removed, and '$NEW_TAG' has been created and pushed."

0 comments on commit efff378

Please sign in to comment.