title: Create releases from within a GitLab runner/pipeline
body: <p>With the release of Gitlab 11.7 in January 2019, we get the new key feature <a href="https://about.gitlab.com/2019/01/22/gitlab-11-7-released/#publish-releases-for-your-projects" rel="noreferrer">Publish releases for your projects</a>. I want precisely what the screenshot on that page shows and I want to be able to download compiled binaries using the <a href="https://docs.gitlab.com/ee/api/releases/" rel="noreferrer">releases API</a>.</p>
  
  <p>I can do it manually. Of course, instructions for the manual approach can be found <a href="https://stackoverflow.com/q/29013457/1129682">here on stack overflow</a>. The problem I need help with is doing it as part of a CI/CD pipeline, which is not covered by the answers one can find easily.</p>
  
  <p>The release notes contain <a href="https://docs.gitlab.com/ee/user/project/releases/index.html" rel="noreferrer">a link to the documentation</a>, which states:</p>
  
  <blockquote>
    <p>we recommend doing this as one of the last steps in your CI/CD release pipeline.</p>
  </blockquote>
  
  <p>From this I gather it's possible. However, the only approach I can imagine is using the GitLab API just as I do, when I create releases manually. When one wants to access the GitLab API one has essentially three options for authentication, according to <a href="https://docs.gitlab.com/ee/api/#authentication" rel="noreferrer">the fine manual</a>: OAUTH2 tokens, personal access tokens and session cookies. Consequently I would need a method for having either of these available in my CI/CD pipeline, with sufficient privileges. Solutions for this problem are an ongoing discussion with lots of contributions, but virtually no tangible progress in recent years.</p>
  
  <p>So, how does one create releases as one of the last steps in one's CI/CD release pipeline?</p>
  
  <p>Storing my personal access key with API access in a CI/CD variable or even a file in the repo is not an option for obvious reasons.</p>