更新 .gitea/workflows/demo.yaml
自动流水线示例 / build (push) Successful in 2m16s Details
自动流水线示例 / deploy (push) Successful in 20s Details
自动流水线示例 / 检查 (push) Successful in 7s Details
自动流水线示例 / 制品上传 (ubuntu-latest, a) (push) Has been skipped Details
自动流水线示例 / 制品上传 (ubuntu-latest, b) (push) Has been skipped Details
自动流水线示例 / 制品上传 (ubuntu-latest, c) (push) Has been skipped Details
自动流水线示例 / upload (ubuntu-latest) (push) Successful in 16s Details
自动流水线示例 / download (push) Failing after 56s Details

发布生产
This commit is contained in:
xiehaijun 2025-07-28 17:36:14 +00:00
parent 3f1f73c8ee
commit 624480984e
1 changed files with 14 additions and 3 deletions

View File

@ -336,14 +336,14 @@ jobs:
echo "标签名称:$TAG_NAME"
- name: Create Gitea Release
id: create_release
run: | #API接口:https://git.ewancle.com/api/swagger和https://docs.gitea.com/zh-cn/development/api-usage
run: | #API接口:https://git.ewancle.com/api/swagger和https://docs.gitea.com/zh-cn/development/api-usage,EOF必须顶格写
response=$(curl -s -X POST "${GITEA_API_URL}/repos/${GITEA_USER1}/${GITEA_REPO1}/releases" \
-H "Authorization: token a94110b4fa993133ceb0e04fdabfd70626e02405" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"tag_name": "${{ env.TAG_NAME }}",
"name": "Release ${{ env.TAG_NAME }}",
"tag_name": "${{ steps.vars.outputs.tag }}",
"name": "Release ${{ steps.vars.outputs.tag }}",
"body": "This release was created automatically by GitHub Actions.",
"draft": false,
"prerelease": false
@ -361,6 +361,17 @@ jobs:
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: Upload artifact to Gitea Release
run: |
FILE_NAME=$(basename $ARTIFACT_FILE)
curl -X POST "${GITEA_API_URL}/repos/${GITEA_USER1}/${GITEA_REPO1}/releases/${{ env.RELEASE_ID }}/assets?name=${FILE_NAME}" \
-H "Authorization: token ${{ secrets.GITEA_PAT }}" \
-H "Content-Type: application/zip" \
--data-binary @"$ARTIFACT_FILE"
- name: ✅ Done
run: echo "🎉 Gitea release $TAG_NAME created and file uploaded!"
#- name: setup go
# uses: actions/setup-go@v5
# with: