parent
3f1f73c8ee
commit
3fdc7cf477
|
|
@ -336,14 +336,14 @@ jobs:
|
||||||
echo "标签名称:$TAG_NAME"
|
echo "标签名称:$TAG_NAME"
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
id: create_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" \
|
response=$(curl -s -X POST "${GITEA_API_URL}/repos/${GITEA_USER1}/${GITEA_REPO1}/releases" \
|
||||||
-H "Authorization: token a94110b4fa993133ceb0e04fdabfd70626e02405" \
|
-H "Authorization: token a94110b4fa993133ceb0e04fdabfd70626e02405" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d @- <<EOF
|
-d @- <<EOF
|
||||||
{
|
{
|
||||||
"tag_name": "${{ env.TAG_NAME }}",
|
"tag_name": "${{ steps.vars.outputs.tag }}",
|
||||||
"name": "Release ${{ env.TAG_NAME }}",
|
"name": "Release ${{ steps.vars.outputs.tag }}",
|
||||||
"body": "This release was created automatically by GitHub Actions.",
|
"body": "This release was created automatically by GitHub Actions.",
|
||||||
"draft": false,
|
"draft": false,
|
||||||
"prerelease": false
|
"prerelease": false
|
||||||
|
|
@ -361,6 +361,17 @@ jobs:
|
||||||
|
|
||||||
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
|
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
|
||||||
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
|
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
|
#- name: setup go
|
||||||
# uses: actions/setup-go@v5
|
# uses: actions/setup-go@v5
|
||||||
# with:
|
# with:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue