Skip to content
Snippets Groups Projects

Use common CI configuration scripts and configs

Merged Mateusz Tyszczak requested to merge tm-use-common-ci-conf-2 into main
Compare and Show latest version
2 files
+ 10
30
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 9
29
@@ -11,7 +11,7 @@ variables:
include:
- project: 'hive/common-ci-configuration'
ref: c17ed3951028ae1ef96fb76e46b9b1652fd6c4aa
ref: 5ca6cf4c97be73985284b11f1d01a27a2e408ab3
file:
- '/templates/npm_projects.gitlab-ci.yml'
@@ -25,6 +25,7 @@ lint:
script:
- npm run lint-ci
# Builds and supplements wiki URL so it is available in Wiki and published package README
build:
stage: build
extends: .npm_build_template
@@ -32,47 +33,25 @@ build:
DIST_DIR: "$CI_PROJECT_DIR/dist"
NPM_PACKAGE_SCOPE: "@hiveio"
NPM_PACKAGE_NAME: "workerbee"
artifacts:
paths:
- "${DIST_DIR}/*.tgz"
when: always
expire_in: 1 week
REPLACE_DOC_URL_ENV: "GEN_DOC_URL"
REPLACE_FILE_PATH: "${CI_PROJECT_DIR}/README.md"
needs:
- job: lint
# Generates documentation and supplements wiki URL so it is available in Wiki and published package README
# Generates documentation
generate_docs:
stage: build
extends: .npm_generate_doc_url
extends: .npm_based_job_base
variables:
DIST_DIR: "$CI_PROJECT_DIR/dist"
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
script:
- |
set -xe
cd "${SOURCE_DIR}"
echo "Attempting to replace generated documentation url placeholder: ${DOC_URL}"
sed -i "s<\${GEN_DOC_URL}<${DOC_URL}<g" README.md
if grep -q "\${GEN_DOC_URL}" README.md; then exit 1; fi # Ensure that the placeholder was replaced
pnpm pack --pack-destination "${DIST_DIR}" --json > ""${DIST_DIR}/built_package_info.json" # repack to include updated README in final package
BUILT_PACKAGE_NAME=$(jq -r .[].filename "${DIST_DIR}/built_package_info.json")
echo BUILT_PACKAGE_PATH="${DIST_DIR}/${BUILT_PACKAGE_NAME}" > built_package_info.env
- scripts/generate_api_docs.sh "${CI_PROJECT_URL}" "${CI_COMMIT_SHA}"
needs:
- job: build
artifacts: true
artifacts:
reports:
dotenv:
- "${SOURCE_DIR}/built_package_info.env" # contains path to produced tgz
paths:
- "${DIST_DIR}/docs"
- "${DIST_DIR}/*.tgz" # Built package
when: always
expire_in: 1 week
@@ -104,9 +83,9 @@ deploy_dev_package:
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
NPM_PACKAGE_SCOPE: "@hiveio"
needs:
- job: lint
- job: test
- job: push_to_wiki
- job: build
artifacts: true
deploy_production_public_npm:
@@ -121,7 +100,8 @@ deploy_production_public_npm:
NPM_PROVENANCE_ENABLE: "0" # XXX: Temporarly disable as it is not working - we have to find a way to get it working
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
needs:
- job: lint
- job: deploy_dev_package
- job: test
- job: push_to_wiki
- job: build
artifacts: true
Loading