.gitea/workflows/update-images.yaml を更新

This commit is contained in:
2025-11-27 11:03:33 +00:00
parent 0d6645430b
commit 37683a37a6

View File

@@ -118,31 +118,43 @@ jobs:
PACKAGE_FILE="${CHART_NAME}-${WP_VERSION}.tgz"
# リリースノートの生成
RELEASE_NOTES="## WordPress Helm Chart v${WP_VERSION}
cat > release_notes.md << 'NOTES'
## WordPress Helm Chart v$WP_VERSION
### Updated Components
### Updated Components
| Component | Previous | Current |
|-----------|----------|---------|
| Nginx | \`${{ steps.nginx.outputs.current }}\` | \`${{ steps.nginx.outputs.latest }}\` |
| WordPress | \`${{ steps.wordpress.outputs.current }}\` | \`${{ steps.wordpress.outputs.latest }}\` |
| Component | Previous | Current |
|-----------|----------|---------|
| Nginx | `$NGINX_OLD` | `$NGINX_NEW` |
| WordPress | `$WP_OLD` | `$WP_NEW` |
### Installation
### Installation
\`\`\`bash
helm repo add myrepo https://gitea.example.com/user/repo/raw/branch/gh-pages
helm repo update
helm install wordpress myrepo/${CHART_NAME} --version ${WP_VERSION}
\`\`\`
```bash
helm repo add myrepo https://gitea.example.com/user/repo/raw/branch/gh-pages
helm repo update
helm install wordpress myrepo/$CHART_NAME --version $WP_VERSION
```
### Upgrade
### Upgrade
\`\`\`bash
helm upgrade wordpress myrepo/${CHART_NAME} --version ${WP_VERSION}
\`\`\`
```bash
helm upgrade wordpress myrepo/$CHART_NAME --version $WP_VERSION
```
---
*This release was automatically generated*"
---
*This release was automatically generated*
NOTES
# 変数を置換
sed -i "s/\$WP_VERSION/${WP_VERSION}/g" release_notes.md
sed -i "s/\$CHART_NAME/${CHART_NAME}/g" release_notes.md
sed -i "s/\$NGINX_OLD/${{ steps.nginx.outputs.current }}/g" release_notes.md
sed -i "s/\$NGINX_NEW/${{ steps.nginx.outputs.latest }}/g" release_notes.md
sed -i "s/\$WP_OLD/${{ steps.wordpress.outputs.current }}/g" release_notes.md
sed -i "s/\$WP_NEW/${{ steps.wordpress.outputs.latest }}/g" release_notes.md
RELEASE_BODY=$(cat release_notes.md | jq -Rs .)
# Gitea APIでリリース作成
curl -X POST \
@@ -151,7 +163,7 @@ helm upgrade wordpress myrepo/${CHART_NAME} --version ${WP_VERSION}
-d "{
\"tag_name\": \"v${WP_VERSION}\",
\"name\": \"WordPress Helm Chart v${WP_VERSION}\",
\"body\": $(echo "$RELEASE_NOTES" | jq -Rs .),
\"body\": ${RELEASE_BODY},
\"draft\": false,
\"prerelease\": false
}" \
@@ -167,7 +179,7 @@ helm upgrade wordpress myrepo/${CHART_NAME} --version ${WP_VERSION}
curl -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/gzip" \
--data-binary @"${PACKAGE_FILE}" \
--data-binary "@${PACKAGE_FILE}" \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${PACKAGE_FILE}"
echo "Gitea release v${WP_VERSION} created with chart package"