Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.39 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
François Bobot's avatar
François Bobot committed
  artifacts:
    paths:
     - bundle-v5.tbz
     - bundle-v7.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
  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:
    PREFIX: '$PROJECT_URI/packages/generic/$PROJECT/$TAG'
    ARCHIVE_V5_NAME: '$PROJECT.$TAG-e5.tbz'
    ARCHIVE_V7_NAME: '$PROJECT.$TAG-e7.tbz'
    PACKAGE_V5_URI: '$PREFIX/$ARCHIVE_V5_NAME'
    PACKAGE_V7_URI: '$PREFIX/$ARCHIVE_V7_NAME'
Christophe Junke's avatar
Christophe Junke committed
  script:
    - apt-get update
    - apt-get install -y curl
    - sed -n -f changelog.sed CHANGES.md > description.txt
    - |
      curl --fail --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bundle-v5.tbz "$PACKAGE_V5_URI"
    - |
      curl --fail --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bundle-v7.tbz "$PACKAGE_V7_URI"
Christophe Junke's avatar
Christophe Junke committed
  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:
    PREFIX: '$PROJECT_URI/packages/generic/$PROJECT/$TAG'
    ARCHIVE_V5_NAME: '$PROJECT.$TAG-e5.tbz'
    ARCHIVE_V7_NAME: '$PROJECT.$TAG-e7.tbz'
    PACKAGE_V5_URI: '$PREFIX/$ARCHIVE_V5_NAME'
    PACKAGE_V7_URI: '$PREFIX/$ARCHIVE_V7_NAME'
Christophe Junke's avatar
Christophe Junke committed
  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_V5_NAME'
          url: '$PACKAGE_V5_URI'
          filepath: '/bundle-v5'
          link_type: 'other'
      links:
        - name: '$ARCHIVE_V7_NAME'
          url: '$PACKAGE_V5_URI'
          filepath: '/bundle-v7'
Christophe Junke's avatar
Christophe Junke committed
          link_type: 'other'
  tags:
    - docker