diff --git a/.gitea/workflows/image-update-and-release.yaml b/.gitea/workflows/image-update-and-release.yaml index 21b4aed..cd6f2d0 100644 --- a/.gitea/workflows/image-update-and-release.yaml +++ b/.gitea/workflows/image-update-and-release.yaml @@ -248,7 +248,7 @@ jobs: echo "Release v${APP_VERSION} created with asset ${PACKAGE_FILE}" fi - - name: Update Helm Repository Index + - name: Publish to Gitea Package Registry if: steps.check_update.outputs.wp_updated == 'true' run: | set -e @@ -256,46 +256,15 @@ jobs: CHART_NAME=$(grep '^name:' Chart.yaml | awk '{print $2}') PACKAGE_FILE="${CHART_NAME}-${APP_VERSION}.tgz" - echo "Preparing Helm repository update..." + echo "🚀 Publishing ${PACKAGE_FILE} to Gitea Package Registry..." - # パッケージファイルを一時ディレクトリに移動 - mkdir -p /tmp/helm-repo - cp "${PACKAGE_FILE}" /tmp/helm-repo/ + curl --fail-with-body \ + -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_TOKEN }}" \ + -X POST \ + --upload-file "${PACKAGE_FILE}" \ + "https://git.cafepieters.com/api/packages/helmchart/helm/api/charts" - # gh-pagesブランチの処理 - if git ls-remote --heads origin gh-pages | grep gh-pages; then - echo "gh-pages branch exists, checking out..." - git fetch origin gh-pages - git checkout gh-pages - else - echo "Creating new gh-pages branch..." - git checkout --orphan gh-pages - git rm -rf . || true - echo "# Helm Repository" > README.md - git config user.name "Gitea Actions Bot" - git config user.email "actions@git.cafepieters.com" - git add README.md - git commit -m "Initialize gh-pages branch" - git push origin gh-pages - fi - - # パッケージファイルをコピー - cp /tmp/helm-repo/"${PACKAGE_FILE}" . - - # index.yamlを生成/更新 - helm repo index . --url "https://git.cafepieters.com/${GITHUB_REPOSITORY}/raw/branch/gh-pages" - - # コミットしてプッシュ - git config user.name "Gitea Actions Bot" - git config user.email "actions@git.cafepieters.com" - git add "${PACKAGE_FILE}" index.yaml - git commit -m "chore: add ${CHART_NAME} v${APP_VERSION}" || echo "No changes to commit" - git push origin gh-pages - - echo "Helm repository updated successfully" - - # mainブランチに戻る - git checkout main + echo "✅ Chart published successfully to Gitea Package Registry" - name: Summary if: always()