aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: ae96f7d859fc34ebc74c93a93993f623e05d78a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.debcommon: &debcommon
  - apt update
  - apt install build-essential debhelper git python3-jinja2 rdfind -y
  - make deb

.rpmcommon: &rpmcommon
  - dnf install make git python3-jinja2 rpmdevtools rdfind -y
  - make rpm

check-commits:
  stage: test
  image: registry.gitlab.com/kernel-firmware/linux-firmware
  rules:
   - if: $CI_MERGE_REQUEST_ID
  script:
    - ci-fairy check-commits --signed-off-by --textwidth=0

pre-commit:
  stage: test
  image: registry.gitlab.com/kernel-firmware/linux-firmware
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  script:
    - pre-commit run --all-files

deb-release:
  stage: deploy
  image: debian
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
      when: never
    - if: $RELEASE_TOKEN
    - if: $CI_COMMIT_TAG
  artifacts:
    paths:
      - dist/*
  script:
    - *debcommon

rpm-release:
  stage: deploy
  image: fedora
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
      when: never
    - if: $RELEASE_TOKEN
    - if: $CI_COMMIT_TAG
  artifacts:
    paths:
      - dist/*
  script:
    - *rpmcommon

release:
  stage: deploy
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
      when: never
    - if: $RELEASE_TOKEN
  artifacts:
    paths:
      - dist/*
  script:
    - CI_PUSH_REPO=`echo "$CI_REPOSITORY_URL" | sed 's/^.*@/@/g'`
    - git remote set-url --push origin "https://gitlab-ci-token:${RELEASE_TOKEN}$CI_PUSH_REPO"
    - git tag `date "+%Y%m%d"`
    - git push --tags
    - make dist