stages:
  - release

release:
  stage: release
  # image:
  #   name: goreleaser/goreleaser
  #   entrypoint: [""]
  image: rust:latest        # ← use Rust image instead of goreleaser image
  variables:
    GIT_DEPTH: 0
    GITLAB_TOKEN: $CI_JOB_TOKEN  # ← add this
  before_script:
    # - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    - curl -fsSL https://goreleaser.com/static/run | bash -s -- --version latest --install-only
    - export PATH=$PATH:/usr/local/bin
  script:
    - goreleaser release --clean
  rules:
    - if: $CI_COMMIT_TAG
