[neon/snap-packaging/plasma-desktop-session-snap/ci-prototype] debian: first try
Carlos De Maine
null at kde.org
Fri Apr 26 00:49:13 BST 2024
Git commit a9bbc1e0dbe4b932bdb76aa37e4c563103599761 by Carlos De Maine.
Committed on 25/04/2024 at 23:49.
Pushed by carlosdem into branch 'ci-prototype'.
first try
M +1 -3 debian/.gitlab-ci-neon.yml
A +25 -0 debian/gitlab-templates/blocks/snap-base.yml
A +16 -0 debian/gitlab-templates/blocks/workflow.yml
A +18 -0 debian/gitlab-templates/snap-snapcraft.lxd
https://invent.kde.org/neon/snap-packaging/plasma-desktop-session-snap/-/commit/a9bbc1e0dbe4b932bdb76aa37e4c563103599761
diff --git a/debian/.gitlab-ci-neon.yml b/debian/.gitlab-ci-neon.yml
index fbda6af..6ee3a96 100644
--- a/debian/.gitlab-ci-neon.yml
+++ b/debian/.gitlab-ci-neon.yml
@@ -2,6 +2,4 @@
# SPDX-License-Identifier: CC0-1.0
include:
- - project: sysadmin/ci-utilities
- file:
- - /gitlab-templates/snap-snapcraft-lxd.yml
\ No newline at end of file
+ - local: ./gitlab-templates/snap-snapcraft-lxd.yml
\ No newline at end of file
diff --git a/debian/gitlab-templates/blocks/snap-base.yml b/debian/gitlab-templates/blocks/snap-base.yml
new file mode 100644
index 0000000..28d88e9
--- /dev/null
+++ b/debian/gitlab-templates/blocks/snap-base.yml
@@ -0,0 +1,25 @@
+.snap_base:
+ stage: build
+ tags:
+ - Snap
+ variables:
+ KDE_SNAP_MODULE_NAME: ${CI_PROJECT_NAME}
+ SNAPCRAFT_BUILD_ENVIRONMENT: "host"
+ SNAPCRAFT_MANAGED_MODE: "y"
+ interruptible: true
+ before_script:
+ - git clone https://invent.kde.org/sysadmin/ci-utilities.git --depth=1
+ - git clone https://invent.kde.org/sysadmin/repo-metadata.git ci-utilities/repo-metadata/ --depth=1
+ script:
+ - git config --global --add safe.directory $CI_PROJECT_DIR
+ artifacts:
+ name: Snap artifacts
+ #expose_as: 'Snaps'
+ when: always
+ paths:
+ - "**/*.snap"
+ - "kde-neon-core-dangerous-amd64.tar.gz"
+ - "kde-neon-core-signed-amd64.tar.gz"
+ - "task.log"
+ - "task-debug.log"
+ expire_in: 7 days
diff --git a/debian/gitlab-templates/blocks/workflow.yml b/debian/gitlab-templates/blocks/workflow.yml
new file mode 100644
index 0000000..c79922e
--- /dev/null
+++ b/debian/gitlab-templates/blocks/workflow.yml
@@ -0,0 +1,16 @@
+stages:
+ - build
+ - test
+ - deploy
+ - publish
+
+workflow:
+ rules:
+ # Prevent branch pipelines if an MR is open on the branch.
+ - if: $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS
+ when: never
+ # Allow merge request pipelines.
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+ # Build tags and branches too
+ - if: $CI_COMMIT_TAG
+ - if: $CI_COMMIT_BRANCH
diff --git a/debian/gitlab-templates/snap-snapcraft.lxd b/debian/gitlab-templates/snap-snapcraft.lxd
new file mode 100644
index 0000000..4c5adba
--- /dev/null
+++ b/debian/gitlab-templates/snap-snapcraft.lxd
@@ -0,0 +1,18 @@
+include:
+ - ./gitlab-templates/blocks/snap-base.yml
+ - ./gitlab-templates/blocks/workflow.yml
+
+snap_snapcraft_lxc:
+ extends: .snap_base
+ inherit:
+ default: true
+ script:
+ - echo building $KDE_SNAP_MODULE_NAME with --use-lxd ...
+ - snapcraft clean
+ - >
+ if [ "$KDE_SNAP_MODULE_NAME" == "plasma-desktop-session-snap" ]; then
+ snapcraft --use-lxd --verbose
+ else
+ snapcraft --use-lxd --verbosity=verbose
+ fi
+ interruptible: true
More information about the Neon-commits
mailing list