From 6e60f9f2ea9d49c290daaa30d3203c7456351b56 Mon Sep 17 00:00:00 2001
From: Romain Boman <r.boman@uliege.be>
Date: Thu, 23 Jun 2022 17:48:42 +0200
Subject: [PATCH] add zenodo to the pipeline

---
 .gitattributes |  2 ++
 .gitlab-ci.yml | 21 ++++++++++++++++++---
 .zenodo.json   | 38 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 3 deletions(-)
 create mode 100644 .zenodo.json

diff --git a/.gitattributes b/.gitattributes
index e75da23..2d5c405 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,5 @@
 *_lfs.* filter=lfs diff=lfs merge=lfs -text
 *.stl filter=lfs diff=lfs merge=lfs -text
 *.wrp filter=lfs diff=lfs merge=lfs -text
+.zenodo.json       export-ignore
+.gitlab-ci.yml     export-ignore
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cd0cf01..ea2a7e3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,12 +1,27 @@
-stages:
-    - build
+# stages:
+#     - build
   
 build_and_test:
     image: registry.gitlab.com/rboman_docker/gmsh_python
-    stage: build
+    # stage: build
     script:
         - cd cxxfem
         - mkdir build
         - cd build
         - cmake -DFEM_USE_MKL=OFF ..
         - make -j 4
+
+send-snapshot:
+  image: python:3.6
+  script:
+    - if [[ ! $CI_COMMIT_TAG =~ ^v?[0-9]+\.[0-9]+ ]]; then exit 0; fi
+    - git clone https://gitlab.com/sbeniamine/gitlab2zenodo.git
+    - cd gitlab2zenodo
+    - python setup.py install
+    - cd ..
+    - rm -rf gitlab2zenodo
+    # - pip install gitlab2zenodo
+    - git archive --format zip --output ${CI_COMMIT_TAG#v}.zip ${CI_COMMIT_TAG}
+    - g2z-send -s -m .zenodo.json ${CI_COMMIT_TAG#v}.zip
+  only:
+    - tags
diff --git a/.zenodo.json b/.zenodo.json
new file mode 100644
index 0000000..442acb1
--- /dev/null
+++ b/.zenodo.json
@@ -0,0 +1,38 @@
+{
+    "title": "A new, fast protocol to simulate biomechanical loading of bone",
+    "upload_type": "software",
+    "description": "Finite element solver (Fossils) and data related to the comparison with Stand7 and Metafor.",
+    "creators": [
+        {
+            "name": "Chatar, Narimane",
+            "affiliation": "University of Liege",
+            "orcid": "0000-0003-0449-8574"
+        },
+        {
+            "name": "Boman, Romain",
+            "affiliation": "University of Liege",
+            "orcid": "0000-0002-4883-0383"
+        },
+        {
+            "name": "Gaudichon, Valentin",
+            "affiliation": "Université de Poitiers-Montpellier"
+        },
+        {
+            "name": "MacLaren, Jamie",
+            "affiliation": "University of Liege",
+            "orcid": "0000-0003-4177-227X"
+        },
+        {
+            "name": "Fischer, Valentin",
+            "affiliation": "University of Liege",
+            "orcid": "0000-0002-8808-6747"
+        }
+    ],
+    "keywords": [
+        "Finite element analysis",
+        "simulation protocol",
+        "biomechanics",
+        "muscle-induced forces",
+        "new keyword"
+    ]
+}
\ No newline at end of file
-- 
GitLab