From 624480984e6a96c8f3432f379776ffe80542f5f9 Mon Sep 17 00:00:00 2001 From: xiehaijun Date: Mon, 28 Jul 2025 17:36:14 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/demo.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 发布生产 --- .gitea/workflows/demo.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 8b06aed..fa3821d 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -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 @- <> $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: