fix(workflows): update R2 bucket and asset paths for consistency across workflows

- Changed default R2_BUCKET from 'get-yaoapps' to 'releases' for better alignment with asset management.
- Updated asset prefix paths in multiple workflows to remove 'releases/' prefix, ensuring uniformity in asset retrieval.
- Enhanced localization in command outputs to reflect updated CDN URLs for better user experience.
This commit is contained in:
Max 2026-04-19 17:55:14 +08:00
parent f7ee21372f
commit b210758370
8 changed files with 65 additions and 51 deletions

View file

@ -154,7 +154,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
R2_BUCKET: ${{ secrets.R2_BUCKET || 'get-yaoapps' }}
R2_BUCKET: ${{ secrets.R2_BUCKET || 'releases' }}
steps:
- name: Checkout (for gh CLI context)
uses: actions/checkout@v4
@ -169,7 +169,7 @@ jobs:
- name: Verify all platform assets on R2
run: |
VERSION="${{ needs.resolve.outputs.version }}"
PREFIX="releases/yao/${VERSION}"
PREFIX="yao/${VERSION}"
PLATFORMS=(
"darwin-arm64"

View file

@ -86,6 +86,27 @@ jobs:
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}"
- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
name: yao-linux
path: artifacts
- name: Prepare Docker Contexts
run: |
VERSION="${{ steps.version.outputs.version }}"
ls -la artifacts/
# Development image uses dev (unstripped) binaries
cp "artifacts/yao-${VERSION}-linux-amd64" docker/development/yao-amd64
cp "artifacts/yao-${VERSION}-linux-arm64" docker/development/yao-arm64
chmod +x docker/development/yao-*
# Production image uses prod (stripped) binaries
cp "artifacts/yao-${VERSION}-linux-amd64-prod" docker/production/yao-amd64
cp "artifacts/yao-${VERSION}-linux-arm64-prod" docker/production/yao-arm64
chmod +x docker/production/yao-*
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -103,8 +124,6 @@ jobs:
with:
context: ./docker/development
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ steps.version.outputs.version }}
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-dev
@ -115,8 +134,6 @@ jobs:
with:
context: ./docker/production
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ steps.version.outputs.version }}
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}

View file

@ -123,13 +123,13 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
R2_BUCKET: ${{ secrets.R2_BUCKET || 'get-yaoapps' }}
R2_BUCKET: ${{ secrets.R2_BUCKET || 'releases' }}
run: |
aws configure set default.region us-east-1
aws configure set default.s3.signature_version s3v4
VERSION="${{ steps.version.outputs.version }}"
PREFIX="releases/yao/${VERSION}"
PREFIX="yao/${VERSION}"
echo "Uploading release binaries to R2: ${PREFIX}"

View file

@ -1,6 +1,6 @@
name: Update CDN latest.json
# Assembles releases/yao/latest.json after all platform binaries are on R2.
# Assembles yao/latest.json after all platform binaries are on R2.
#
# Normally triggered automatically by notarize-macos.yml's finalize job after
# notarization completes. Can also be triggered manually as a fallback.
@ -14,7 +14,7 @@ on:
description: "Engine version to publish (e.g. 1.0.0 or 1.0.0-alpha)"
required: true
mark_latest:
description: "Also update releases/yao/latest.json (set false for pre-releases you want on CDN but not as latest)"
description: "Also update yao/latest.json (set false for pre-releases you want on CDN but not as latest)"
required: false
default: "true"
@ -28,7 +28,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
R2_BUCKET: ${{ secrets.R2_BUCKET || 'get-yaoapps' }}
R2_BUCKET: ${{ secrets.R2_BUCKET || 'releases' }}
CDN_BASE: https://get.yaoapps.com
steps:
- name: Configure AWS CLI
@ -39,7 +39,7 @@ jobs:
- name: Verify platform assets exist
run: |
VERSION="${{ github.event.inputs.version }}"
PREFIX="releases/yao/${VERSION}"
PREFIX="yao/${VERSION}"
PLATFORMS=(
"darwin-arm64"
@ -76,7 +76,7 @@ jobs:
python3 <<PY > /tmp/latest.json
import json
version = "${VERSION}"
base = "${CDN_BASE}/releases/yao/${VERSION}"
base = "${CDN_BASE}/yao/${VERSION}"
assets = {
"darwin-arm64": f"{base}/yao-{version}-darwin-arm64",
"darwin-amd64": f"{base}/yao-{version}-darwin-amd64",
@ -104,17 +104,17 @@ jobs:
run: |
VERSION="${{ github.event.inputs.version }}"
aws s3 cp /tmp/latest.json \
"s3://${R2_BUCKET}/releases/yao/${VERSION}/latest.json" \
"s3://${R2_BUCKET}/yao/${VERSION}/latest.json" \
--endpoint-url "$R2_ENDPOINTS" \
--content-type "application/json" \
--cache-control "public, max-age=60"
- name: Promote to releases/yao/latest.json
- name: Promote to yao/latest.json
if: ${{ github.event.inputs.mark_latest != 'false' }}
run: |
aws s3 cp /tmp/latest.json \
"s3://${R2_BUCKET}/releases/yao/latest.json" \
"s3://${R2_BUCKET}/yao/latest.json" \
--endpoint-url "$R2_ENDPOINTS" \
--content-type "application/json" \
--cache-control "public, max-age=60"
echo "Promoted to releases/yao/latest.json"
echo "Promoted to yao/latest.json"

View file

@ -72,7 +72,7 @@ var langs = map[string]string{
"🎉Successfully updated to version: %s🎉": "🎉成功更新到版本: %s🎉",
"Skip interactive confirmation": "跳过交互式确认",
"Only check for updates and print JSON result": "仅检查更新并输出 JSON 结果",
"Custom download source URL (e.g. https://get.yaoapps.com/releases/yao)": "自定义下载源 URL (例如 https://get.yaoapps.com/releases/yao)",
"Custom download source URL (e.g. https://get.yaoapps.com/yao)": "自定义下载源 URL (例如 https://get.yaoapps.com/yao)",
"Print all version information": "显示详细版本信息",
"SUI Template Engine": "SUI 模板引擎命令",
"MCP commands": "MCP 包管理命令",

View file

@ -18,7 +18,7 @@ import (
)
const githubReleasesAPI = "https://api.github.com/repos/YaoApp/yao/releases/latest"
const cdnFallbackBase = "https://get.yaoapps.com/releases/yao"
const cdnFallbackBase = "https://get.yaoapps.com/yao"
// Upgrade command flags
var (
@ -164,7 +164,7 @@ func resolveLatest() (string, string, error) {
// resolveFromCDN fetches latest.json from the given CDN base URL.
// The URL should point to the directory containing latest.json,
// e.g. "https://get.yaoapps.com/releases/yao".
// e.g. "https://get.yaoapps.com/yao".
func resolveFromCDN(base string) (string, string, error) {
url := strings.TrimRight(base, "/") + "/latest.json"
client := &http.Client{Timeout: 30 * time.Second}
@ -438,5 +438,5 @@ func copyFile(src, dst string) error {
func init() {
upgradeCmd.Flags().BoolVarP(&upgradeYes, "yes", "y", false, L("Skip interactive confirmation"))
upgradeCmd.Flags().BoolVar(&upgradeCheck, "check", false, L("Only check for updates and print JSON result"))
upgradeCmd.Flags().StringVar(&upgradeSource, "source", "", L("Custom download source URL (e.g. https://get.yaoapps.com/releases/yao)"))
upgradeCmd.Flags().StringVar(&upgradeSource, "source", "", L("Custom download source URL (e.g. https://get.yaoapps.com/yao)"))
}

View file

@ -4,14 +4,12 @@
# docker run --rm yaoapp/yao:1.0.0-alpha-dev yao version
# ===========================================
FROM ubuntu:24.04
ARG VERSION
ARG TARGETARCH
RUN groupadd -r yao && useradd -r -g yao yao && \
apt-get update && \
apt-get install -y curl sudo procps net-tools
RUN curl -fsSL "https://pub-80136338e60643edbb55c6ca8a689cf8.r2.dev/archives/yao-${VERSION}-linux-${TARGETARCH}" > /usr/local/bin/yao && \
chmod +x /usr/local/bin/yao && \
mkdir -p /data/app
COPY yao-${TARGETARCH} /usr/local/bin/yao
RUN chmod +x /usr/local/bin/yao && mkdir -p /data/app
VOLUME /data/app
WORKDIR /data/app

View file

@ -4,11 +4,10 @@
# docker run --rm yaoapp/yao:1.0.0-alpha yao version
# ===========================================
FROM alpine:latest
ARG VERSION
ARG TARGETARCH
RUN apk --no-cache add curl
RUN curl -fsSL "https://pub-80136338e60643edbb55c6ca8a689cf8.r2.dev/archives/yao-${VERSION}-linux-${TARGETARCH}-prod" > /usr/local/bin/yao && \
chmod +x /usr/local/bin/yao && \
COPY yao-${TARGETARCH} /usr/local/bin/yao
RUN chmod +x /usr/local/bin/yao && \
addgroup -S yao && adduser -S -G yao yao && \
mkdir -p /data/app && \
chown -R yao:yao /data/app