This commit is contained in:
10
.github/workflows/publish-charts.yml
vendored
10
.github/workflows/publish-charts.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
|
||||
- name: Find and process charts
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
HELM_REGISTRY_TOKEN: ${{ secrets.HELM_REGISTRY_TOKEN }}
|
||||
run: |
|
||||
echo "🔍 Searching for Helm charts..."
|
||||
CHARTS_FOUND=0
|
||||
@@ -63,11 +63,11 @@ jobs:
|
||||
CHART_FILE="packages/$NAME-$VERSION.tgz"
|
||||
|
||||
# Publish to Gitea Registry
|
||||
if [ -n "$GITEA_TOKEN" ]; then
|
||||
if [ -n "$HELM_REGISTRY_TOKEN" ]; then
|
||||
echo "Publishing $CHART_FILE to registry..."
|
||||
|
||||
HTTP_CODE=$(curl -w "%{http_code}" -s -o /dev/null \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Authorization: token $HELM_REGISTRY_TOKEN" \
|
||||
-X POST \
|
||||
--upload-file "$CHART_FILE" \
|
||||
"$GITEA_URL/api/packages/$GITEA_OWNER/helm/api/charts")
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
echo "🔍 Verifying publication..."
|
||||
sleep 5
|
||||
|
||||
if curl -s -H "Authorization: token $GITEA_TOKEN" \
|
||||
if curl -s -H "Authorization: token $HELM_REGISTRY_TOKEN" \
|
||||
"$GITEA_URL/api/packages/$GITEA_OWNER/helm/index.yaml" \
|
||||
| grep -q "$NAME-$VERSION"; then
|
||||
echo "✅ Chart $CHART_NAME verified in registry!"
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "⚠️ GITEA_TOKEN not set, skipping publication"
|
||||
echo "⚠️ HELM_REGISTRY_TOKEN not set, skipping publication"
|
||||
fi
|
||||
else
|
||||
echo "ℹ️ Skipping publication (not on main/master branch)"
|
||||
|
||||
Reference in New Issue
Block a user