[gjs: 1/2] CI: create a flatpak of unstable GJS



commit 917160bfb3817ba84d02a30ca797a7faa25d7a1e
Author: Claudio André <claudioandre br gmail com>
Date:   Sat May 5 21:02:52 2018 -0300

    CI: create a flatpak of unstable GJS
    
    The goal is dogfooding. Allow interested people to try, safely, the
    bleeding-hot GJS. It could be SpiderMonkey 60 or some invasive memory
    management patches. Anyone would be able to use GJS-devel and feel how,
    e.g., gnome-shell behaves after a change.

 .gitlab-ci.yml               | 24 ++++++++++++++++++++++--
 test/org.gnome.GjsDevel.json | 32 ++++++++++++++++++++++++++++++++
 test/test-ci.sh              | 14 ++++++++++++++
 3 files changed, 68 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2bf130a8..dc1512ce 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,7 +5,7 @@ stages:
 - source_check
 - test
 - thorough_tests
-- docs
+- delivery
 
 .build: &build
   when: on_success
@@ -22,6 +22,7 @@ stages:
     - $(pwd)/*.log
     - $(pwd)/Makefile
     - $(pwd)/configure
+    - $(pwd)/*.flatpak
 
   script:
     # CI starts here. Previous messages are GitLab Runner setup.
@@ -220,7 +221,7 @@ code_statistics:
 # Publish the Code Coverage Report
 #############################################
 pages:
-  stage: docs
+  stage: delivery
   dependencies:
     - coverage
   script:
@@ -264,3 +265,22 @@ lts:
     CC: gcc
     TEST: "check"
   when: manual
+
+#############################################
+# Flatpak packaging
+#############################################
+packaging:
+  <<: *build
+  stage: delivery
+  image: registry.gitlab.gnome.org/gnome/gnome-nightly-oci/nightly:master
+  variables:
+    CODECHECK: "FLATPAK"
+    APPID: "org.gnome.GjsDevel"
+    BUNDLE: "org.gnome.GjsDevel.flatpak"
+    MANIFEST_PATH: "org.gnome.GjsDevel.json"
+    RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo";
+
+  environment:
+    name: review/$CI_COMMIT_REF_NAME
+    url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
+  when: manual
diff --git a/test/org.gnome.GjsDevel.json b/test/org.gnome.GjsDevel.json
new file mode 100644
index 00000000..9af08d08
--- /dev/null
+++ b/test/org.gnome.GjsDevel.json
@@ -0,0 +1,32 @@
+{
+    "id": "<<ID>>",
+    "branch": "<<master>>",
+    "runtime": "org.gnome.Platform",
+    "runtime-version": "master",
+    "sdk": "org.gnome.Sdk",
+    "command": "gjs-console",
+    "tags": ["unstable", "development"],
+    "finish-args": [
+        "--filesystem=host",
+        "--share=ipc",
+        "--share=network",
+        "--device=dri",
+        "--socket=x11",
+        "--socket=wayland",
+        "--socket=pulseaudio"
+    ],
+    "modules": [
+        {
+            "name": "gjs",
+            "buildsystem": "autotools",
+            "builddir": true,
+            "sources": [
+                {
+                    "type": "git",
+                    "branch": "<<current>>",
+                    "path": "."
+                }
+            ]
+        }
+    ]
+}
diff --git a/test/test-ci.sh b/test/test-ci.sh
index badccfe6..529ef48a 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -303,6 +303,20 @@ elif [[ $1 == "TOKEI" ]]; then
     do_Print_Labels 'Project statistics'
 
     tokei . | tee "$save_dir"/analysis/report.txt
+
+elif [[ $1 == "FLATPAK" ]]; then
+    do_Print_Labels 'Flatpak packaging'
+
+    # Move the manifest file to the root folder
+    cp test/*.json .
+
+    # Ajust to the current branch
+    sed -i "s,<<ID>>,$APPID,g" ${MANIFEST_PATH}
+    sed -i "s,<<master>>,master,g" ${MANIFEST_PATH}
+    sed -i "s,<<current>>,origin/$CI_COMMIT_REF_NAME,g" ${MANIFEST_PATH}
+
+    flatpak-builder --bundle-sources --repo=devel build ${MANIFEST_PATH}
+    flatpak build-bundle devel ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APPID}
 fi
 
 # Releases stuff and finishes


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]