.gitlab-ci.yml 2.06 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
Stéphane Veyret's avatar
Stéphane Veyret committed
27
28

.nvm_env: &nvm_env
releaser-duniter's avatar
releaser-duniter committed
29
30
31
32
33
  tags:
    - redshift
  before_script:
    - export NVM_DIR="$HOME/.nvm"
    - . "$NVM_DIR/nvm.sh"
Stéphane Veyret's avatar
Stéphane Veyret committed
34
35
36
37
  
build:
  <<: *nvm_env
  stage: build
releaser-duniter's avatar
releaser-duniter committed
38
39
40
41
  script:
    - yarn

test:
Stéphane Veyret's avatar
Stéphane Veyret committed
42
  <<: *nvm_env
releaser-duniter's avatar
releaser-duniter committed
43
44
45
46
  stage: test
  script:
    - yarn
    - yarn test
47

Stéphane Veyret's avatar
Stéphane Veyret committed
48
.build_releases: &build_releases
releaser-duniter's avatar
releaser-duniter committed
49
  stage: releases
Stéphane Veyret's avatar
Stéphane Veyret committed
50
  allow_failure: false
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
Stéphane Veyret's avatar
Stéphane Veyret committed
54
55
56
57
58
59
60
  when: manual
  artifacts:
    paths: &releases_artifacts
      - work/bin/

releases:test:
  <<: *build_releases
Stéphane Veyret's avatar
Stéphane Veyret committed
61
  script:
releaser-duniter's avatar
releaser-duniter committed
62
    - 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
63
  artifacts:
Stéphane Veyret's avatar
Stéphane Veyret committed
64
65
    paths: *releases_artifacts
    expire_in: 4h
66
67
  except:
    - tags
Stéphane Veyret's avatar
Stéphane Veyret committed
68

releaser-duniter's avatar
releaser-duniter committed
69
releases:
Stéphane Veyret's avatar
Stéphane Veyret committed
70
  <<: *build_releases
Stéphane Veyret's avatar
Stéphane Veyret committed
71
72
73
  script:
    - bash "release/arch/linux/build-lin.sh" "${CI_COMMIT_TAG#v}"
  artifacts:
Stéphane Veyret's avatar
Stéphane Veyret committed
74
75
    paths: *releases_artifacts
    expire_in: 2 weeks
Stéphane Veyret's avatar
Stéphane Veyret committed
76
  only:
Stéphane Veyret's avatar
Stéphane Veyret committed
77
78
    - tags

releaser-duniter's avatar
releaser-duniter committed
79
releases-message:
releaser-duniter's avatar
releaser-duniter committed
80
  stage: releases-page
Stéphane Veyret's avatar
Stéphane Veyret committed
81
  allow_failure: false
Éloïs's avatar
Éloïs committed
82
  image: tensorflow/tensorflow:latest-py3
Éloïs's avatar
Éloïs committed
83
84
  tags:
    - redshift-duniter-builder
85
  variables:
releaser-duniter's avatar
releaser-duniter committed
86
    JOB_ARTIFACTS: 'releases'
87
    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
88
  script:
89
    - python3 .gitlab/releaser.py
Éloïs's avatar
Éloïs committed
90
  when: manual
91
  only:
Stéphane Veyret's avatar
Stéphane Veyret committed
92
    - tags