From 5614bd6ada1176792c15281d676d201a63adb27b Mon Sep 17 00:00:00 2001 From: "direct-dev.ru" Date: Sun, 27 Jul 2025 13:18:21 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20workflow=20-=205=20=D0=B4=D0=BB=D1=8F=20=D1=81?= =?UTF-8?q?=D0=B1=D0=BE=D1=80=D0=BA=D0=B8=20=D0=B8=20=D1=80=D0=B5=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 980461e..aaa570b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: repository: 'GiteaAdmin/hello_gitea' path: 'hello_gitea' token: ${{ secrets.GITEATOKEN }} - git-server-url: 'https://direct-dev.ru/gitea' + ref: ${{ github.ref }} - name: Build run: | @@ -23,13 +23,28 @@ jobs: ls -la bin/ - name: Create Release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITEATOKEN }} - GITHUB_API_URL: 'https://direct-dev.ru/gitea/api/v1' - with: - tag_name: ${{ github.ref_name }} - name: "Release ${{ github.ref_name }}" - body: "Automated release" - files: | - hello_gitea/bin/hello-api-${{ github.ref_name }} \ No newline at end of file + run: | + cd hello_gitea + # Create release using Gitea API + curl -X POST \ + -H "Authorization: token ${{ secrets.GITEATOKEN }}" \ + -H "Content-Type: application/json" \ + -d '{ + "tag_name": "${{ github.ref_name }}", + "name": "Release ${{ github.ref_name }}", + "body": "Automated release", + "draft": false, + "prerelease": false + }' \ + "https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases" + + # Upload asset + RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITEATOKEN }}" \ + "https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases/tags/${{ github.ref_name }}" | \ + jq -r '.id') + + curl -X POST \ + -H "Authorization: token ${{ secrets.GITEATOKEN }}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary @bin/hello-api-${{ github.ref_name }} \ + "https://direct-dev.ru/gitea/api/v1/repos/GiteaAdmin/hello_gitea/releases/$RELEASE_ID/assets?name=hello-api-${{ github.ref_name }}" \ No newline at end of file