.gitlab-ci.yml 2.1 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
  - build
Éloïs's avatar
Éloïs committed
4
  - 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
  script:
    - yarn

Éloïs's avatar
Éloïs committed
42
43
44
45
46
47
test:
  <<: *nvm_env
  stage: test
  script:
    - yarn
    - yarn test
Éloïs's avatar
Éloïs committed
48
    - sed -n 23p coverage/index.html
Éloïs's avatar
Éloïs committed
49

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

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

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

Stéphane Veyret's avatar
Stéphane Veyret committed
81
.release_jobs: &release_jobs
É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
Cédric Moreau's avatar
Cédric Moreau committed
85
  script:
86
    - python3 .gitlab/releaser
87
  only:
Stéphane Veyret's avatar
Stéphane Veyret committed
88
    - tags
Stéphane Veyret's avatar
Stéphane Veyret committed
89
90
91
92
93
94
95
96
97
98
99
100

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

publish:
  <<: *release_jobs
  stage: release
  variables:
101
    RELEASE_BIN_DIR: work/bin/
Stéphane Veyret's avatar
Stéphane Veyret committed
102
103
104
    WIKI_RELEASE: Releases
  allow_failure: false
  when: manual