2024-09-24 19:21:44 +02:00
|
|
|
image: ubuntu:latest
|
|
|
|
|
|
|
|
|
2024-09-22 01:45:32 +02:00
|
|
|
stages:
|
2024-09-24 19:21:44 +02:00
|
|
|
- build
|
2024-09-22 01:45:32 +02:00
|
|
|
- release
|
|
|
|
|
2024-09-24 19:21:44 +02:00
|
|
|
variables:
|
|
|
|
MANIFEST: "system.json"
|
|
|
|
ZIPFILE: "kidsonbrooms.zip"
|
|
|
|
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}"
|
|
|
|
MANIFEST_RELEASE_URL: "${PACKAGE_REGISTRY_URL}/${MANIFEST}"
|
|
|
|
ZIPFILE_RELEASE_URL: "${PACKAGE_REGISTRY_URL}/${ZIPFILE}"
|
|
|
|
MANIFEST_PERMALINK_URL: "https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/releases/permalink/latest/downloads/${MANIFEST}"
|
|
|
|
ZIPFILE_PERMALINK_URL: "https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/releases/${CI_COMMIT_TAG}/downloads/${ZIPFILE}"
|
|
|
|
dry_run: true
|
|
|
|
|
|
|
|
|
|
|
|
# Build job
|
|
|
|
build:
|
|
|
|
stage: build
|
2024-09-22 01:54:53 +02:00
|
|
|
before_script:
|
2024-09-23 17:58:07 +02:00
|
|
|
# Install Node.js v21.x manually
|
2024-09-22 01:55:02 +02:00
|
|
|
- apt-get update && apt-get install -y curl
|
2024-09-22 01:54:53 +02:00
|
|
|
- curl -fsSL https://deb.nodesource.com/setup_21.x | bash -
|
|
|
|
- apt-get install -y nodejs
|
|
|
|
- node -v # Verify the correct Node.js version
|
|
|
|
# Install Gulp globally
|
2024-09-22 01:45:32 +02:00
|
|
|
- npm install --global gulp-cli
|
2024-09-22 01:54:53 +02:00
|
|
|
- gulp --version # Verify Gulp is installed
|
|
|
|
script:
|
2024-09-22 01:45:32 +02:00
|
|
|
- npm install
|
2024-09-24 19:21:44 +02:00
|
|
|
- gulp build
|
2024-09-23 17:58:07 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- kidsonbrooms.zip
|
2024-09-24 19:21:44 +02:00
|
|
|
- system.json
|
|
|
|
- packs/
|
|
|
|
only:
|
|
|
|
- branches
|
2024-09-22 01:45:32 +02:00
|
|
|
|
2024-09-24 19:21:44 +02:00
|
|
|
# Release job
|
2024-09-22 01:45:32 +02:00
|
|
|
release:
|
|
|
|
stage: release
|
2024-09-24 19:21:44 +02:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
2024-09-22 01:45:32 +02:00
|
|
|
before_script:
|
2024-09-23 17:58:07 +02:00
|
|
|
# Install Node.js v21.x manually
|
2024-09-24 19:21:44 +02:00
|
|
|
- apt-get update && apt-get install -y curl
|
2024-09-22 01:54:53 +02:00
|
|
|
- curl -fsSL https://deb.nodesource.com/setup_21.x | bash -
|
|
|
|
- apt-get install -y nodejs
|
|
|
|
- node -v # Verify the correct Node.js version
|
|
|
|
# Install Gulp globally
|
2024-09-22 01:45:32 +02:00
|
|
|
- npm install --global gulp-cli
|
2024-09-22 01:54:53 +02:00
|
|
|
- gulp --version # Verify Gulp is installed
|
2024-09-22 01:45:32 +02:00
|
|
|
script:
|
2024-09-22 16:56:10 +02:00
|
|
|
- npm install
|
2024-09-22 01:45:32 +02:00
|
|
|
- gulp release
|
2024-09-24 19:21:44 +02:00
|
|
|
only:
|
|
|
|
- tags
|
2024-09-22 01:45:32 +02:00
|
|
|
|
2024-09-24 19:21:44 +02:00
|
|
|
# Create GitLab release
|
|
|
|
create-release:
|
|
|
|
stage: release
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
variables:
|
|
|
|
dry_run: "false"
|
|
|
|
needs:
|
|
|
|
- job: release
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
script:
|
|
|
|
- echo "Creating GitLab release for $CI_COMMIT_TAG"
|
|
|
|
release:
|
|
|
|
name: "$CI_COMMIT_TAG"
|
|
|
|
tag_name: "$CI_COMMIT_TAG"
|
|
|
|
description: "Release $CI_COMMIT_TAG of $CI_PROJECT_NAME."
|
|
|
|
assets:
|
|
|
|
links:
|
|
|
|
- name: "$MANIFEST"
|
|
|
|
url: "${MANIFEST_RELEASE_URL}"
|
|
|
|
filepath: "/${MANIFEST}"
|
|
|
|
- name: "$ZIPFILE"
|
|
|
|
url: "${ZIPFILE_PERMALINK_URL}"
|
|
|
|
filepath: "/${ZIPFILE}"
|
2024-09-22 01:45:32 +02:00
|
|
|
|