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:
parent
f7ee21372f
commit
b210758370
8 changed files with 65 additions and 51 deletions
4
.github/workflows/notarize-macos.yml
vendored
4
.github/workflows/notarize-macos.yml
vendored
|
|
@ -154,7 +154,7 @@ jobs:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
|
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
|
||||||
R2_BUCKET: ${{ secrets.R2_BUCKET || 'get-yaoapps' }}
|
R2_BUCKET: ${{ secrets.R2_BUCKET || 'releases' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout (for gh CLI context)
|
- name: Checkout (for gh CLI context)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -169,7 +169,7 @@ jobs:
|
||||||
- name: Verify all platform assets on R2
|
- name: Verify all platform assets on R2
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ needs.resolve.outputs.version }}"
|
VERSION="${{ needs.resolve.outputs.version }}"
|
||||||
PREFIX="releases/yao/${VERSION}"
|
PREFIX="yao/${VERSION}"
|
||||||
|
|
||||||
PLATFORMS=(
|
PLATFORMS=(
|
||||||
"darwin-arm64"
|
"darwin-arm64"
|
||||||
|
|
|
||||||
25
.github/workflows/release-linux.yml
vendored
25
.github/workflows/release-linux.yml
vendored
|
|
@ -86,6 +86,27 @@ jobs:
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
echo "VERSION=${VERSION}"
|
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
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
|
@ -103,8 +124,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: ./docker/development
|
context: ./docker/development
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
build-args: |
|
|
||||||
VERSION=${{ steps.version.outputs.version }}
|
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-dev
|
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-dev
|
||||||
|
|
@ -115,8 +134,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: ./docker/production
|
context: ./docker/production
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
build-args: |
|
|
||||||
VERSION=${{ steps.version.outputs.version }}
|
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
|
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
|
||||||
|
|
|
||||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
|
|
@ -123,13 +123,13 @@ jobs:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
|
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
|
||||||
R2_BUCKET: ${{ secrets.R2_BUCKET || 'get-yaoapps' }}
|
R2_BUCKET: ${{ secrets.R2_BUCKET || 'releases' }}
|
||||||
run: |
|
run: |
|
||||||
aws configure set default.region us-east-1
|
aws configure set default.region us-east-1
|
||||||
aws configure set default.s3.signature_version s3v4
|
aws configure set default.s3.signature_version s3v4
|
||||||
|
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
PREFIX="releases/yao/${VERSION}"
|
PREFIX="yao/${VERSION}"
|
||||||
|
|
||||||
echo "Uploading release binaries to R2: ${PREFIX}"
|
echo "Uploading release binaries to R2: ${PREFIX}"
|
||||||
|
|
||||||
|
|
|
||||||
18
.github/workflows/update-cdn-latest.yml
vendored
18
.github/workflows/update-cdn-latest.yml
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
name: Update CDN latest.json
|
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
|
# Normally triggered automatically by notarize-macos.yml's finalize job after
|
||||||
# notarization completes. Can also be triggered manually as a fallback.
|
# 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)"
|
description: "Engine version to publish (e.g. 1.0.0 or 1.0.0-alpha)"
|
||||||
required: true
|
required: true
|
||||||
mark_latest:
|
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
|
required: false
|
||||||
default: "true"
|
default: "true"
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
|
R2_ENDPOINTS: ${{ secrets.R2_ENDPOINTS }}
|
||||||
R2_BUCKET: ${{ secrets.R2_BUCKET || 'get-yaoapps' }}
|
R2_BUCKET: ${{ secrets.R2_BUCKET || 'releases' }}
|
||||||
CDN_BASE: https://get.yaoapps.com
|
CDN_BASE: https://get.yaoapps.com
|
||||||
steps:
|
steps:
|
||||||
- name: Configure AWS CLI
|
- name: Configure AWS CLI
|
||||||
|
|
@ -39,7 +39,7 @@ jobs:
|
||||||
- name: Verify platform assets exist
|
- name: Verify platform assets exist
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ github.event.inputs.version }}"
|
VERSION="${{ github.event.inputs.version }}"
|
||||||
PREFIX="releases/yao/${VERSION}"
|
PREFIX="yao/${VERSION}"
|
||||||
|
|
||||||
PLATFORMS=(
|
PLATFORMS=(
|
||||||
"darwin-arm64"
|
"darwin-arm64"
|
||||||
|
|
@ -76,7 +76,7 @@ jobs:
|
||||||
python3 <<PY > /tmp/latest.json
|
python3 <<PY > /tmp/latest.json
|
||||||
import json
|
import json
|
||||||
version = "${VERSION}"
|
version = "${VERSION}"
|
||||||
base = "${CDN_BASE}/releases/yao/${VERSION}"
|
base = "${CDN_BASE}/yao/${VERSION}"
|
||||||
assets = {
|
assets = {
|
||||||
"darwin-arm64": f"{base}/yao-{version}-darwin-arm64",
|
"darwin-arm64": f"{base}/yao-{version}-darwin-arm64",
|
||||||
"darwin-amd64": f"{base}/yao-{version}-darwin-amd64",
|
"darwin-amd64": f"{base}/yao-{version}-darwin-amd64",
|
||||||
|
|
@ -104,17 +104,17 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ github.event.inputs.version }}"
|
VERSION="${{ github.event.inputs.version }}"
|
||||||
aws s3 cp /tmp/latest.json \
|
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" \
|
--endpoint-url "$R2_ENDPOINTS" \
|
||||||
--content-type "application/json" \
|
--content-type "application/json" \
|
||||||
--cache-control "public, max-age=60"
|
--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' }}
|
if: ${{ github.event.inputs.mark_latest != 'false' }}
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp /tmp/latest.json \
|
aws s3 cp /tmp/latest.json \
|
||||||
"s3://${R2_BUCKET}/releases/yao/latest.json" \
|
"s3://${R2_BUCKET}/yao/latest.json" \
|
||||||
--endpoint-url "$R2_ENDPOINTS" \
|
--endpoint-url "$R2_ENDPOINTS" \
|
||||||
--content-type "application/json" \
|
--content-type "application/json" \
|
||||||
--cache-control "public, max-age=60"
|
--cache-control "public, max-age=60"
|
||||||
echo "Promoted to releases/yao/latest.json"
|
echo "Promoted to yao/latest.json"
|
||||||
|
|
|
||||||
46
cmd/root.go
46
cmd/root.go
|
|
@ -56,29 +56,29 @@ var langs = map[string]string{
|
||||||
"✨STOPPED✨": "✨服务已停止✨",
|
"✨STOPPED✨": "✨服务已停止✨",
|
||||||
"SessionPort": "会话服务端口",
|
"SessionPort": "会话服务端口",
|
||||||
"Force migrate": "强制更新数据表结构",
|
"Force migrate": "强制更新数据表结构",
|
||||||
"Migrate is not allowed on production mode.": "Migrate 不能再生产环境下使用",
|
"Migrate is not allowed on production mode.": "Migrate 不能再生产环境下使用",
|
||||||
"Upgrade yao to latest version": "升级 yao 到最新版本",
|
"Upgrade yao to latest version": "升级 yao 到最新版本",
|
||||||
"Current version:": "当前版本:",
|
"Current version:": "当前版本:",
|
||||||
"Latest version: ": "最新版本: ",
|
"Latest version: ": "最新版本: ",
|
||||||
"Checking latest version...": "正在检查最新版本...",
|
"Checking latest version...": "正在检查最新版本...",
|
||||||
"🎉Current version is the latest🎉": "🎉当前版本是最新的🎉",
|
"🎉Current version is the latest🎉": "🎉当前版本是最新的🎉",
|
||||||
"Do you want to update to %s ? (y/n): ": "是否更新到 %s ? (y/n): ",
|
"Do you want to update to %s ? (y/n): ": "是否更新到 %s ? (y/n): ",
|
||||||
"Invalid input": "输入错误",
|
"Invalid input": "输入错误",
|
||||||
"Canceled upgrade": "已取消更新",
|
"Canceled upgrade": "已取消更新",
|
||||||
"Downloading...": "正在下载...",
|
"Downloading...": "正在下载...",
|
||||||
"Progress:": "进度:",
|
"Progress:": "进度:",
|
||||||
"Available assets:": "可用的制品:",
|
"Available assets:": "可用的制品:",
|
||||||
"Error occurred while updating binary: %s": "更新二进制文件时出错: %s",
|
"Error occurred while updating binary: %s": "更新二进制文件时出错: %s",
|
||||||
"🎉Successfully updated to version: %s🎉": "🎉成功更新到版本: %s🎉",
|
"🎉Successfully updated to version: %s🎉": "🎉成功更新到版本: %s🎉",
|
||||||
"Skip interactive confirmation": "跳过交互式确认",
|
"Skip interactive confirmation": "跳过交互式确认",
|
||||||
"Only check for updates and print JSON result": "仅检查更新并输出 JSON 结果",
|
"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": "显示详细版本信息",
|
"Print all version information": "显示详细版本信息",
|
||||||
"SUI Template Engine": "SUI 模板引擎命令",
|
"SUI Template Engine": "SUI 模板引擎命令",
|
||||||
"MCP commands": "MCP 包管理命令",
|
"MCP commands": "MCP 包管理命令",
|
||||||
"MCP package management commands": "MCP 包管理命令",
|
"MCP package management commands": "MCP 包管理命令",
|
||||||
"Robot commands": "Robot 包管理命令",
|
"Robot commands": "Robot 包管理命令",
|
||||||
"Robot package management commands": "Robot 包管理命令",
|
"Robot package management commands": "Robot 包管理命令",
|
||||||
}
|
}
|
||||||
|
|
||||||
// L Language switch
|
// L Language switch
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const githubReleasesAPI = "https://api.github.com/repos/YaoApp/yao/releases/latest"
|
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
|
// Upgrade command flags
|
||||||
var (
|
var (
|
||||||
|
|
@ -164,7 +164,7 @@ func resolveLatest() (string, string, error) {
|
||||||
|
|
||||||
// resolveFromCDN fetches latest.json from the given CDN base URL.
|
// resolveFromCDN fetches latest.json from the given CDN base URL.
|
||||||
// The URL should point to the directory containing latest.json,
|
// 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) {
|
func resolveFromCDN(base string) (string, string, error) {
|
||||||
url := strings.TrimRight(base, "/") + "/latest.json"
|
url := strings.TrimRight(base, "/") + "/latest.json"
|
||||||
client := &http.Client{Timeout: 30 * time.Second}
|
client := &http.Client{Timeout: 30 * time.Second}
|
||||||
|
|
@ -438,5 +438,5 @@ func copyFile(src, dst string) error {
|
||||||
func init() {
|
func init() {
|
||||||
upgradeCmd.Flags().BoolVarP(&upgradeYes, "yes", "y", false, L("Skip interactive confirmation"))
|
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().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)"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,12 @@
|
||||||
# docker run --rm yaoapp/yao:1.0.0-alpha-dev yao version
|
# docker run --rm yaoapp/yao:1.0.0-alpha-dev yao version
|
||||||
# ===========================================
|
# ===========================================
|
||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
ARG VERSION
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
RUN groupadd -r yao && useradd -r -g yao yao && \
|
RUN groupadd -r yao && useradd -r -g yao yao && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y curl sudo procps net-tools
|
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 && \
|
COPY yao-${TARGETARCH} /usr/local/bin/yao
|
||||||
chmod +x /usr/local/bin/yao && \
|
RUN chmod +x /usr/local/bin/yao && mkdir -p /data/app
|
||||||
mkdir -p /data/app
|
|
||||||
|
|
||||||
VOLUME /data/app
|
VOLUME /data/app
|
||||||
WORKDIR /data/app
|
WORKDIR /data/app
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,10 @@
|
||||||
# docker run --rm yaoapp/yao:1.0.0-alpha yao version
|
# docker run --rm yaoapp/yao:1.0.0-alpha yao version
|
||||||
# ===========================================
|
# ===========================================
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
ARG VERSION
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
RUN apk --no-cache add curl
|
RUN apk --no-cache add curl
|
||||||
RUN curl -fsSL "https://pub-80136338e60643edbb55c6ca8a689cf8.r2.dev/archives/yao-${VERSION}-linux-${TARGETARCH}-prod" > /usr/local/bin/yao && \
|
COPY yao-${TARGETARCH} /usr/local/bin/yao
|
||||||
chmod +x /usr/local/bin/yao && \
|
RUN chmod +x /usr/local/bin/yao && \
|
||||||
addgroup -S yao && adduser -S -G yao yao && \
|
addgroup -S yao && adduser -S -G yao yao && \
|
||||||
mkdir -p /data/app && \
|
mkdir -p /data/app && \
|
||||||
chown -R yao:yao /data/app
|
chown -R yao:yao /data/app
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue