image: ubuntu:latest stages: - build - release 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 before_script: # Install Node.js v21.x manually - apt-get update && apt-get install -y curl - 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 - npm install --global gulp-cli - gulp --version # Verify Gulp is installed script: - npm install - gulp build artifacts: paths: - kidsonbrooms.zip - system.json - packs/ only: - branches # Release job release: stage: release rules: - if: $CI_COMMIT_TAG before_script: # Install Node.js v21.x manually - apt-get update && apt-get install -y curl - 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 - npm install --global gulp-cli - gulp --version # Verify Gulp is installed script: - npm install - gulp release only: - tags # 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}"