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

Éloïs's avatar
Éloïs committed
8
push_to_github:
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  stage: github-sync
  variables:
    GIT_STRATEGY: none
  tags:
    - redshift
  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 $?"
  only:
    - nodes/typescript/duniter
releaser-duniter's avatar
releaser-duniter committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        
build:
  stage: build
  tags:
    - redshift
  before_script:
    - export NVM_DIR="$HOME/.nvm"
    - . "$NVM_DIR/nvm.sh"
  script:
    - yarn

test:
  stage: test
  tags:
    - redshift
  before_script:
    - export NVM_DIR="$HOME/.nvm"
    - . "$NVM_DIR/nvm.sh"
  script:
    - yarn
    - yarn test
48

releaser-duniter's avatar
releaser-duniter committed
49
50
releases:test:
  stage: releases
51
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
52
  tags:
Éloïs's avatar
Éloïs committed
53
    - redshift-duniter-builder
54
  variables:
releaser-duniter's avatar
releaser-duniter committed
55
56
57
    DAY: $(date +%Y%m%d)
    HOUR: $(date +%H%M)
    SEC: $(date +%S)
Stéphane Veyret's avatar
Stéphane Veyret committed
58
  script:
releaser-duniter's avatar
releaser-duniter committed
59
    - bash "release/arch/linux/build-lin.sh" "$(date +%Y%m%d).$(date +%H%M).$(date +%S)"
Stéphane Veyret's avatar
Stéphane Veyret committed
60
61
  artifacts:
    paths:
releaser-duniter's avatar
releaser-duniter committed
62
      - work/bin/
Stéphane Veyret's avatar
Stéphane Veyret committed
63
    expire_in: 8h
Éloïs's avatar
Éloïs committed
64
  when: manual
65
66
  except:
    - tags
Stéphane Veyret's avatar
Stéphane Veyret committed
67

releaser-duniter's avatar
releaser-duniter committed
68
69
releases:
  stage: releases
70
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
71
  tags:
Éloïs's avatar
Éloïs committed
72
    - redshift-duniter-builder
Stéphane Veyret's avatar
Stéphane Veyret committed
73
74
75
76
  script:
    - bash "release/arch/linux/build-lin.sh" "${CI_COMMIT_TAG#v}"
  artifacts:
    paths:
releaser-duniter's avatar
releaser-duniter committed
77
78
79
      - work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.deb
      - work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.tar.gz
      - work/bin/duniter-server-${CI_COMMIT_TAG}-linux-x64.deb
80
    expire_in: 8h
Éloïs's avatar
Éloïs committed
81
  when: manual
Stéphane Veyret's avatar
Stéphane Veyret committed
82
  only:
Éloïs's avatar
Éloïs committed
83
  - tags
Éloïs's avatar
Éloïs committed
84
  - master
85
    
releaser-duniter's avatar
releaser-duniter committed
86
releases-message:
releaser-duniter's avatar
releaser-duniter committed
87
  stage: releases-page
Éloïs's avatar
Éloïs committed
88
  image: tensorflow/tensorflow:latest-py3
Éloïs's avatar
Éloïs committed
89
90
  tags:
    - redshift-duniter-builder
91
  variables:
releaser-duniter's avatar
releaser-duniter committed
92
    JOB_ARTIFACTS: 'releases'
93
    EXPECTED_ARTIFACTS: '["work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.deb","work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.tar.gz","work/bin/duniter-server-${CI_COMMIT_TAG}-linux-x64.deb"]'
Cédric Moreau's avatar
Cédric Moreau committed
94
  script:
95
    - python3 .gitlab/releaser.py
Éloïs's avatar
Éloïs committed
96
  when: manual
97
  only:
Éloïs's avatar
Éloïs committed
98
  - tags
Éloïs's avatar
Éloïs committed
99
  - master