From 52adb9e12499ec497f6684426d0c71fee9e472c8 Mon Sep 17 00:00:00 2001
From: Jonathan Swaelens <swaelens.jonathan@opensides.be>
Date: Mon, 19 Mar 2018 11:45:06 +0100
Subject: [PATCH] :sparkles: feat(gitlab-ci): Add release tarballs in CI

Add release tarballs in CI

Signed-off-by: Jonathan Swaelens <swaelens.jonathan@opensides.be>
---
 .gitlab-ci.yml | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 78c92e78d..77f5948e6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,7 +10,7 @@ stages:
   - codestyle
   - manpages
   - transifex
-  - build-tarballs
+  - tarballs
 
 ## Stage lint
 
@@ -123,10 +123,20 @@ update-transifex:
     - tx push -f -s -t --skip --no-interactive
 
 build-tarballs:
-  stage: build-tarballs
+  stage: tarballs
   script:
     - tar -cvzf fusiondirectory-core.tar.gz *
   artifacts:
     paths:
     - fusiondirectory-core.tar.gz
     expire_in: 1h
+
+build-release:
+  stage: tarballs
+  only:
+    - tags
+  script: 
+    - tar -cvzf fusiondirectory-core-$(grep '*' Changelog | head -n1 | cut -d ' ' -f3).tar.gz *
+  artifacts:
+    paths:
+      - fusiondirectory-core-$(grep '*' Changelog | head -n1 | cut -d ' ' -f3).tar.gz
-- 
GitLab