diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 005b64c..bf39d43 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -8,7 +8,7 @@ on: permissions: contents: write - + jobs: build: runs-on: ubuntu-latest @@ -127,17 +127,36 @@ jobs: run: | FULL_VERSION=$(cat VERSION) VERSION=$(echo "$FULL_VERSION" | cut -d '-' -f1) + COMMIT=$(git rev-parse HEAD) + echo "πŸš€ Creating release: $VERSION" + echo "πŸ” Commit: $COMMIT" + echo "πŸ“¦ Based on build: $FULL_VERSION" git config user.name "GitHub Actions" git config user.email "actions@github.com" - git tag "$VERSION" - git push origin "$VERSION" + # Crear tag si no existe aΓΊn + if git rev-parse "$VERSION" >/dev/null 2>&1; then + echo "⚠️ Tag $VERSION already exists. Skipping tag creation." + else + git tag "$VERSION" + git push origin "$VERSION" + fi + + echo "πŸ” Generating changelog..." + CHANGELOG="πŸ”– Version: $VERSION - CHANGELOG=$(git log --pretty=format:"- %s (%an)" $(git describe --tags --abbrev=0)..HEAD) + πŸ” Based on internal build: $FULL_VERSION + πŸ”€ Commit: $COMMIT + πŸ“‹ Changes: + $(git log --pretty=format:"- %s (%an)" $(git describe --tags --abbrev=0)..HEAD)" + + echo "🧹 Deleting release if already exists..." gh release delete "$VERSION" -y || true + + echo "πŸ“¦ Creating GitHub release..." gh release create "$VERSION" --title "$VERSION" --notes "$CHANGELOG" - name: Notify Telegram - success