How to add the artifacts as an asset to a release when using Gitlab semantic-release?

134 views Asked by At

I have gitlab ci config and using semantic-release How to add the artifacts as an asset to a release page?

stages:
  - release

release:
  stage: release
  rules:
    - if: $CI_COMMIT_BRANCH == "release"
  image: node:lts
  before_script:
    - git submodule sync
    - git submodule update --init --recursive
  script:
    - cd frontend
    - npm install
    - npm run build
    - rm -rf $(ls -A | grep -v dist)
    - cd ../release
    - npm install -g semantic-release @semantic-release/gitlab @semantic-release/changelog conventional-changelog-conventionalcommits @semantic-release/git
    - export GL_TOKEN=${GL_TOKEN}
    - GL_TOKEN=${GL_TOKEN} npx semantic-release
    - rm -rf ../.git/
  artifacts:
    name: "dashboard-$CI_COMMIT_SHA"
    exclude:
      - ".gitignore"
      - ".gitlab-ci.yml"
      - ".gitmodules"
    paths:
      - "./"

have artifact file in release page

0

There are 0 answers