image: docker-registry.schukai.com:443/nixos-ci-devenv:latest

services:
  - docker:dind


variables:
  NIXOS_VERSION: "23.05"
  NIXPKGS_ALLOW_UNFREE: "1"
  NIXPKGS_ALLOW_INSECURE: "1"
  DOCKER_DRIVER: overlay2


stages:
  - tag
  - release


tag-it:
  tags:
    - nixos
  stage: tag
  script:
    - devenv shell tag-version
  only:
    - master
  except:
    - tags

release:
  tags:
    - nixos
  stage: release
  image:
    name: goreleaser/goreleaser
    entrypoint: [""]
  only:
    - tags
  variables:
    # Disable shallow cloning so that goreleaser  can diff between tags to
    GIT_DEPTH: 0
  script:
    - cd source; goreleaser release --clean

