.gitlab-ci.yml 1.71 KB
Newer Older
Éloïs's avatar
Éloïs committed
1
stages:
Stéphane Veyret's avatar
Stéphane Veyret committed
2
  - github-sync
Éloïs's avatar
Éloïs committed
3
4
  - build
  - test
5
6
  - release
  - release-message
Éloïs's avatar
Éloïs committed
7

Éloïs's avatar
Éloïs committed
8
9
10
11
12
push_to_github:
    stage: github-sync
    variables:
        GIT_STRATEGY: none
    tags:
13
        - redshift
Éloïs's avatar
Éloïs committed
14
15
16
17
18
19
20
21
22
23
24
    script:
        - rm -rf ./*
        - rm -rf .git
        - git clone --mirror $CI_REPOSITORY_URL .
        - git remote add github $GITHUB_URL_AND_KEY
        - git config --global user.email "contact@duniter.org"
        - git config --global user.name "Duniter"
        # Job would fail if we don't remove refs about pull requests
        - bash -c "cat packed-refs | grep -v 'refs/pull' > packed-refs-new; echo 'Removed pull refs.'"
        - mv packed-refs-new packed-refs
        - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
25
26
27

release_linux:test:
  stage: release
Éloïs's avatar
Éloïs committed
28
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
29
  tags:
Éloïs's avatar
Éloïs committed
30
    - redshift-duniter-builder
Stéphane Veyret's avatar
Stéphane Veyret committed
31
32
33
34
35
36
  script:
    - bash "release/arch/linux/build-lin.sh" "$(date +%Y%m%d).$(date +%H%M).$(date +%S)"
  artifacts:
    paths:
      - work/bin/
    expire_in: 8h
Éloïs's avatar
Éloïs committed
37
  when: manual
38
39
40
  except:
    - tags
  
Stéphane Veyret's avatar
Stéphane Veyret committed
41

42
43
release_linux:deploy:
  stage: release
Éloïs's avatar
Éloïs committed
44
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
45
  tags:
Éloïs's avatar
Éloïs committed
46
    - redshift-duniter-builder
Stéphane Veyret's avatar
Stéphane Veyret committed
47
48
49
50
51
  script:
    - bash "release/arch/linux/build-lin.sh" "${CI_COMMIT_TAG#v}"
  artifacts:
    paths:
      - work/bin/
Éloïs's avatar
Éloïs committed
52
  when: manual
Stéphane Veyret's avatar
Stéphane Veyret committed
53
  only:
Éloïs's avatar
Éloïs committed
54
  - tags
Éloïs's avatar
Éloïs committed
55
  - master
56
57
58
    
enforce-message:
  stage: release-message
59
  image: tensorflow/tensorflow:latest-py3
60
  variables:
Éloïs's avatar
Éloïs committed
61
    JOB_ARTIFACTS: 'release'
62
    EXPECTED_ARTIFACTS: '["duniter-desktop-${CI_COMMIT_TAG}-linux-x64.deb","duniter-desktop-${CI_COMMIT_TAG}-linux-x64.tar.gz","duniter-server-${CI_COMMIT_TAG}-linux-x64.deb"]'
Cédric Moreau's avatar
Cédric Moreau committed
63
  script:
64
    - python3 .gitlab/releaser.py
Éloïs's avatar
Éloïs committed
65
  when: manual
66
  only:
Éloïs's avatar
Éloïs committed
67
  - tags
Éloïs's avatar
Éloïs committed
68
  - master