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