Compare commits

...

4 Commits
v0.3 ... main

Author SHA1 Message Date
00ce91f9ed 更新 README.md
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 23s
2025-02-17 21:34:52 +00:00
luo980
48cb6cf5e8 check release id info
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 22s
2025-02-18 04:45:34 +08:00
luo980
5328f64726 check release id info
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 22s
2025-02-18 04:43:26 +08:00
luo980
b690745eb2 fullfill the tag info
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 23s
2025-02-18 04:38:31 +08:00
2 changed files with 28 additions and 0 deletions

View File

@ -37,12 +37,16 @@ jobs:
- name: Extract Release Info from Git
id: release_info
run: |
TAG_NAME=$(git describe --tags --abbrev=0)
echo "tag_name=$TAG_NAME" >> $GITHUB_ENV
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
echo "commit_message=$COMMIT_MESSAGE" >> $GITHUB_ENV
echo "Tag Name: $TAG_NAME"
echo "Branch Name: $BRANCH_NAME"
echo "Commit Message: $COMMIT_MESSAGE"
- name: Upload to Gitea Release
@ -53,6 +57,7 @@ jobs:
RELEASE_DATA=$(curl -X POST -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"$GITHUB_ENV\",
\"target_commitish\": \"$branch_name\",
\"name\": \"$tag_name\",
\"body\": \"$commit_message\",
@ -63,6 +68,8 @@ jobs:
# 提取 Release ID
RELEASE_ID=$(echo "$RELEASE_DATA" | jq -r '.id')
echo "Release id is $RELEASE_ID"
# 上传文件
curl -X POST -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \

View File

@ -1,2 +1,23 @@
# xmake-helloworld-runner
runner已经部署主要编写对象为.gitea/workflow/.yaml文件
当前流程为拉取container环境ubuntu-latest -> 安装xmake -> 编译 -> 打包二进制 -> gitea api申请release id -> 根据id将release文件post上传发布
需要注意几个事项:
1. runner已经完成部署当前直接编写workflow自动触发使用即可runner环境已配好科学上网环境所以涉及翻墙安装的软件或者克隆的仓库不会出问题
2. 自己申请一个personal token作为API令牌使用API地址参考 https://git.luo980.site/api/swagger
3. 后续依赖库确定的情况下建议后续自己制作docker镜像作为base编译环境runner机器下载后会缓存避免再通过xmake和apt反复耗时耗流量安装环境容器环境在编译后会自然销毁因此下次启动时又会从base初始化
4. 暂且使用gitea的release作为下载地址后续我会抽时间建立registry作为替代release最终作为稳定版本发布使用
5. 及时确定当前依赖库的版本,对于不需要高版本和新特性的支持,以当前可用版本定义,后续根据时间进行测试升级依赖库版本
6. 当前action过程只为二进制编译如涉及到动态库链接或者静态编译注意统一打包发布解压所得开箱即用
7. 涉及到测试项可编写多个Action作为每次更新可以一并进行自动化验证防止疏漏
8. 当前action触发条件为push更新即开始自己根据需要定义不同粒度