Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.89 KiB
Newer Older
Christophe Junke's avatar
Christophe Junke committed
variables:
  PROJECT: 'colibri'
  ID: '804'
  PROJECT_URI: 'https://git.frama-c.com/api/v4/projects/$ID'

stages:
  - build
  - test

build:
Christophe Junke's avatar
Christophe Junke committed
  image: ocaml/opam:debian-10-ocaml-4.14
François Bobot's avatar
François Bobot committed
  script:
   - sudo apt-get update
   - sudo apt-get install -y make libgmp-dev
   - opam install dune.3.12.1 fmt.0.9.0 gen.1.1 menhir.20230608 ocplib-simplex.0.5 parsexp.v0.16.0 spelll.0.4 uutf.1.0.3 zarith.1.13
   - make clean_bundle
   - make bundle
Christophe Junke's avatar
Christophe Junke committed
   - make bundle.tbz
François Bobot's avatar
François Bobot committed
  artifacts:
    paths:
Christophe Junke's avatar
Christophe Junke committed
     - bundle.tbz
François Bobot's avatar
François Bobot committed
    expire_in: 1 week
François Bobot's avatar
François Bobot committed
  tags:
François Bobot's avatar
François Bobot committed
    - docker
Christophe Junke's avatar
Christophe Junke committed
  image: debian:10
  stage: test
  needs: [build]
  script:
    - apt-get update
    - apt-get install -y make parallel
    - make test
  artifacts:
    paths:
      - logs
    expire_in: 1 week
  tags:
    - docker

Christophe Junke's avatar
Christophe Junke committed
prepare-release:
  image: debian:10
  needs: [build]
  rules:
    - if: $CI_PIPELINE_SOURCE == "trigger"
  variables:
    ARCHIVE_NAME: '$PROJECT.$TAG.tbz'
    PACKAGE_URI: '$PROJECT_URI/$PROJECT/$TAG/$ARCHIVE_NAME'
  script:
    - apt-get update
    - apt-get install -y curl
    - sed -n -f changelog.sed CHANGES.md > description.txt
    - |
      curl --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" --upload-file bundle.tbz "$PACKAGE_URI"
  artifacts:
    paths:
      - description.txt
  tags:
    - docker

release:
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  needs: [prepare-release]
  rules:
    - if: $CI_PIPELINE_SOURCE == "trigger"
  variables:
    ARCHIVE_NAME: '$PROJECT.$TAG.tbz'
    PACKAGE_URI: '$PROJECT_URI/$PROJECT/$TAG/$ARCHIVE_NAME'
  script:
    - echo "Release job for tag $TAG"
  release:
    name: "Release $TAG"
    description: description.txt
    tag_name: "$TAG"
    ref: '$CI_COMMIT_SHA'
    milestones: []
    assets:
      links:
        - name: '$ARCHIVE_NAME'
          url: '$PACKAGE_URI'
          filepath: '/bundle'
          link_type: 'other'
  tags:
    - docker