ci: remove docker gha cache and publish charts to gitea
Release Chart / release (push) Failing after 1m7s
deploy / build (push) Canceled after 4m18s

This commit is contained in:
2026-07-22 23:23:07 +03:30
parent b74fb06b87
commit 6da652a478
3 changed files with 105 additions and 2 deletions
+50
View File
@@ -92,6 +92,56 @@ jobs:
TAG: ${{ github.ref_name }}
run: gh release upload "$TAG" "$CHART_PACKAGE" --clobber
- name: Upload Helm chart artifact to Gitea release
if: steps.version.outputs.is_app_release == 'true' && secrets.GITEA_TOKEN != ''
env:
GITEA_BASE_URL: https://git.kloude.ir
GITEA_REPO: kloude/kks-provider-plugin
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
if [ ! -f "$CHART_PACKAGE" ]; then
echo "Chart package not found: $CHART_PACKAGE"
exit 1
fi
api="${GITEA_BASE_URL}/api/v1/repos/${GITEA_REPO}"
file_name=$(basename "$CHART_PACKAGE")
release_json=$(curl -fsS \
-H "Authorization: token ${GITEA_TOKEN}" \
"${api}/releases/tags/${TAG}" || true)
if [ -z "$release_json" ]; then
release_json=$(curl -fsS -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"${api}/releases" \
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"target_commitish\":\"${GITHUB_SHA}\"}")
fi
release_id=$(python3 -c 'import json,sys; print(json.loads(sys.stdin.read())["id"])' <<< "$release_json")
existing_assets=$(curl -fsS \
-H "Authorization: token ${GITEA_TOKEN}" \
"${api}/releases/${release_id}/assets")
existing_asset_id=$(python3 -c 'import json,sys; assets=json.loads(sys.stdin.read()); name=sys.argv[1]; print(next((str(a["id"]) for a in assets if a.get("name")==name), ""))' "$file_name" <<< "$existing_assets")
if [ -n "$existing_asset_id" ]; then
curl -fsS -X DELETE \
-H "Authorization: token ${GITEA_TOKEN}" \
"${api}/releases/${release_id}/assets/${existing_asset_id}"
fi
curl -fsS -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/gzip" \
--data-binary "@${CHART_PACKAGE}" \
"${api}/releases/${release_id}/assets?name=${file_name}"
- name: Log in to registry
if: steps.version.outputs.is_app_release == 'true'
uses: docker/login-action@v3