Compare commits

...

2 Commits
main ... v0.3

Author SHA1 Message Date
luo980
f723a58868 add jq
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 23s
2025-02-18 05:00:51 +08:00
luo980
b6e032e90f fullfill tag info on v0.1
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 24s
2025-02-18 04:52:20 +08:00

View File

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