Create new Release via API with attachment

Hi there,

Perhaps it’s the wrong way, but im looking for a way to automate (via api) the release.

My setup

  • I have a repo called “test_repo” for example
  • With Jenkins I build a new version, where it can grap the correct version number from the source code
  • Jenkins produced an artifact that I’d like to include in the release that I created in the Gitea repo “test_repo”.

I like to automate this process so Jenkins can create the release for me and also add the artifact into the release. I know I can create a new release via the API, but I cannot add the artifact into that API call.

So my question, how can I automate a release in Gitea and add the correct Artifact as well?

You are looking for the POST /repos/{owner}/{repo}/releases/{id}/assets route for adding attachments to releases.

Great, missed that one! Thanks

1 Like