update
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-10-12 18:14:04 +08:00
commit c9412702df

59
.woodpecker.yml Normal file
View File

@@ -0,0 +1,59 @@
# 只调度到你的 macOS 本机 agentlocal/exec
labels:
host: Mac-mini.local
platform: darwin/arm64
gpu: metal
when:
event: [push, manual, pull_request]
steps:
- name: create some file
image: /bin/zsh
commands:
- echo "Hello, World!" > hello.txt
- name: upload-hello-txt
image: /bin/zsh
environment:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
S3_BUCKET: ${S3_BUCKET}
S3_ENDPOINT: ${S3_ENDPOINT}
commands:
- |
set -e
if [[ -n "$AWS_ACCESS_KEY_ID" && -n "$AWS_SECRET_ACCESS_KEY" && -n "$S3_BUCKET" ]]; then
echo "Uploading hello.txt to S3..."
# 设置 plugin-s3 环境变量
export PLUGIN_SOURCE="hello.txt"
export PLUGIN_BUCKET="$S3_BUCKET"
export PLUGIN_TARGET="woodpecker-test/"
[[ -n "$S3_ENDPOINT" ]] && export PLUGIN_ENDPOINT="$S3_ENDPOINT" && export PLUGIN_PATH_STYLE=true
plugin-s3
echo "✅ hello.txt uploaded successfully!"
else
echo "⚠️ No S3 credentials found. Skipping upload."
fi
- name: s3-upload-demo
image: /bin/zsh
environment:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
S3_BUCKET: ${S3_BUCKET}
S3_ENDPOINT: ${S3_ENDPOINT}
commands:
- |
set -e
if [[ -n "$AWS_ACCESS_KEY_ID" && -n "$AWS_SECRET_ACCESS_KEY" && -n "$S3_BUCKET" ]]; then
echo "Hello S3 from Woodpecker at $(date)" > s3-demo.txt
# plugin-s3 的环境变量(与容器版一致)
export PLUGIN_SOURCE="s3-demo.txt"
export PLUGIN_BUCKET="$S3_BUCKET"
export PLUGIN_TARGET="woodpecker-demo/"
[[ -n "$S3_ENDPOINT" ]] && export PLUGIN_ENDPOINT="$S3_ENDPOINT" && export PLUGIN_PATH_STYLE=true
plugin-s3
else
echo "No S3 creds found. Skipping s3-upload-demo."
fi