How to give public access to private repository CI artefacts?

Problem to solve

I can give access to the release. but when I make a CI that puts Release.zip up from a build artifact no-one without login can download it since the CI/CD is private.
I can’t make that public either since that’s not possible with a private repo … so what is the point of public releases when all i can link to from the CI are private artifacts ?

Do I have to use some work-around or do I really need to host the files myself somewhere else? It would be quite a pain to need to deploy a server as well that hosts this and would take away form the automation I want to have.

  • What are you seeing, and how does that differ from what you expect to see?
  • Consider including screenshots, error messages, and/or other helpful visuals

I can create a link to my finished artifact. A c++ compressed Release set.

job_release:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  needs:
    - job: job_build
      artifacts: true
  rules:
    - if: $CI_COMMIT_TAG
  script:
    - echo "running release_job"
  release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
    tag_name: '$CI_COMMIT_TAG'
    description: 'Release $CI_COMMIT_TAG for $CI_PROJECT_NAME'
    assets:
      links:
        - name: 'ReleaseLinux.zip'
          url: 'https://<myServer>/<group>/<project>/-/jobs/$LINUX_JOB_ID/artifacts/download'
          filepath: '/ReleaseLinux.zip'

I get the $LINUX_JOB from the previous task.
The link works perfectly well (also from the ‘release page’) if I am logged into my user on my browser. On a private window, so a public access, I can see the file and release but i can’t download it which makes kind-of sense as i get a 403 since the file is in the CI which is private.

Steps to reproduce

Make a repo, make the repo code private but the releases public. Write a CI that publishes a job artifact. Done, you can see the release, you can see the link, but you can’t download it.

Configuration

Provide screenshots from the GitLab UI showing relevant configuration, if applicable.
On self-managed instances, add the relevant configuration settings or changes.

Versions

Versions

  • GitLab v16.9.1