OpenMiInk/third_party/kde-ci-utilities/gitlab-templates/blocks/snap-base.yml
Hellings b8c8ff98e2 Hi
2026-10-16 09:05:56 -04:00

106 lines
3.2 KiB
YAML

.snap_base:
stage: deploy
image: storage.kde.org/vm-images/snap-builder
tags:
- VM
- amd64
variables:
KDE_SNAP_MODULE_NAME: ${CI_PROJECT_NAME}
KDE_SNAP_BRANCH: ${CI_COMMIT_REF_NAME}
SNAPCRAFT_BUILD_ENVIRONMENT: "lxd"
SNAPCRAFT_BUILD_INFO: "1"
SNAPCRAFT_IMAGE_INFO: '{"build_request_id": "$CI_JOB_ID", "build_request_timestamp": "$CI_JOB_STARTED_AT", "build_url": "$CI_JOB_URL"}'
SNAPCRAFT_MANAGED_MODE: "y"
rules:
# run the job on mainline branches of mainline repositories
- if: $KDECI_SECURE_SERVICES_KEY
when: on_success
# or if the manifest was modified
- changes:
paths:
- snapcraft.yaml
- snap/snapcraft.yaml
when: on_success
# or when triggered manually
- when: manual
# we don't want the manual job to block the pipeline
allow_failure: true
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 deploy artifacts
expose_as: "KDE neon snaps deploying artifacts"
when: always
paths:
- "kde-ci-packages/"
expire_in: 7 days
.snap_base_arm64:
stage: deploy
image: storage.kde.org/vm-images/snap-builder-arm64
tags:
- VM
- arm64
variables:
KDE_SNAP_MODULE_NAME: ${CI_PROJECT_NAME}
KDE_SNAP_BRANCH: ${CI_COMMIT_REF_NAME}
SNAPCRAFT_BUILD_ENVIRONMENT: "lxd"
SNAPCRAFT_BUILD_INFO: "1"
SNAPCRAFT_IMAGE_INFO: '{"build_request_id": "$CI_JOB_ID", "build_request_timestamp": "$CI_JOB_STARTED_AT", "build_url": "$CI_JOB_URL"}'
SNAPCRAFT_MANAGED_MODE: "y"
rules:
# run the job on mainline branches of mainline repositories
- if: $KDECI_SECURE_SERVICES_KEY
when: on_success
# or if the manifest was modified
- changes:
paths:
- snapcraft.yaml
- snap/snapcraft.yaml
when: on_success
# or when triggered manually
- when: manual
# we don't want the manual job to block the pipeline
allow_failure: true
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 deploy artifacts
expose_as: "KDE neon snaps deploying artifacts"
when: always
paths:
- "kde-ci-packages/arm64/"
expire_in: 7 days
.snap_publish:
stage: publish
image: storage.kde.org/vm-images/snap-builder
tags:
- VM
- amd64
rules:
# only publish when the appropriate credentials are available
- if: $SNAPCRAFT_STORE_CREDENTIALS
when: on_success
# run the job on mainline branches of mainline repositories
#- if: $KDECI_SECURE_SERVICES_KEY
# when: on_success
variables:
GIT_STRATEGY: none
interruptible: true
artifacts:
name: Snap publish artifacts
expose_as: "KDE neon snaps publishing artifacts"
when: always
paths:
- "publish.log"
- "publish-arm64.log"
expire_in: 7 days