Mise à jour effectuée, merci de nous signaler tout dysfonctionnement ! | Upgrade done, please let us know about any dysfunction!

.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
Stéphane Veyret's avatar
Stéphane Veyret committed
5
6
7
  - package
  - prerelease
  - release
8

Éloïs's avatar
Éloïs committed
9
push_to_github:
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  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
28
29

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

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

Stéphane Veyret's avatar
Stéphane Veyret committed
49
.build_releases: &build_releases
Stéphane Veyret's avatar
Stéphane Veyret committed
50
  stage: package
Stéphane Veyret's avatar
Stéphane Veyret committed
51
  allow_failure: false
52
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
53
  tags:
Éloïs's avatar
Éloïs committed
54
    - redshift-duniter-builder
Stéphane Veyret's avatar
Stéphane Veyret committed
55
56
57
58
59
60
61
  when: manual
  artifacts:
    paths: &releases_artifacts
      - work/bin/

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

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

Stéphane Veyret's avatar
Stéphane Veyret committed
80
.release_jobs: &release_jobs
Éloïs's avatar
Éloïs committed
81
  image: tensorflow/tensorflow:latest-py3
Éloïs's avatar
Éloïs committed
82
83
  tags:
    - redshift-duniter-builder
Cédric Moreau's avatar
Cédric Moreau committed
84
  script:
85
86
    - python3 .gitlab/releaser.py
  only:
Stéphane Veyret's avatar
Stéphane Veyret committed
87
    - tags
Stéphane Veyret's avatar
Stéphane Veyret committed
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

prerelease:
  <<: *release_jobs
  stage: prerelease
  variables:
    RELEASE_BIN_DIR: work/bin/
    SOURCE_EXT: '["tar.gz", "zip"]'
    RELEASE_JOB: publish

publish:
  <<: *release_jobs
  stage: release
  variables:
    WIKI_RELEASE: Releases
  allow_failure: false
  when: manual