2024-09-26 02:50:43 +02:00
|
|
|
image: ubuntu:latest
|
|
|
|
|
|
|
|
|
2024-09-22 01:45:32 +02:00
|
|
|
stages:
|
2024-09-26 02:50:43 +02:00
|
|
|
- build
|
2024-09-22 01:45:32 +02:00
|
|
|
- release
|
|
|
|
|
2024-09-26 02:50:43 +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}"
|
2024-09-26 14:08:48 +02:00
|
|
|
MANIFEST_PERMALINK_URL: "https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/releases/${CI_COMMIT_TAG}/downloads/${MANIFEST}"
|
2024-09-26 02:50:43 +02:00
|
|
|
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-26 02:50:43 +02:00
|
|
|
- gulp build
|
2024-09-23 17:58:07 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- kidsonbrooms.zip
|
2024-09-26 02:50:43 +02:00
|
|
|
- system.json
|
|
|
|
- packs/
|
|
|
|
only:
|
|
|
|
- branches
|
2024-09-22 01:45:32 +02:00
|
|
|
|
2024-09-26 02:50:43 +02:00
|
|
|
# Release job
|
2024-09-22 01:45:32 +02:00
|
|
|
release:
|
|
|
|
stage: release
|
2024-09-26 02:50:43 +02:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
variables:
|
|
|
|
dry_run: "false"
|
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-26 02:50:43 +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-26 02:50:43 +02:00
|
|
|
# Create GitLab release
|
|
|
|
create-release:
|
|
|
|
stage: release
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
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"
|
2024-09-26 14:08:24 +02:00
|
|
|
url: "${ZIPFILE_RELEASE_URL}"
|
2024-09-26 02:50:43 +02:00
|
|
|
filepath: "/${ZIPFILE}"
|
2024-09-22 01:45:32 +02:00
|
|
|
|