From e2ba6c52e37298ddbd5a2e1de355b3b98948ff74 Mon Sep 17 00:00:00 2001 From: Marek Lesko Date: Mon, 14 Jul 2025 18:49:06 +0000 Subject: [PATCH] Added release pipeline --- .gitlab-ci.yml | 16 ++++++++++++++-- .releaserc.json | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .releaserc.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 341ac2f..b6fce1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,8 @@ + stages: # Define the stages of the pipeline. - build #- test - - deploy + - release install-job: # This job runs in the build stage, which runs first. stage: build @@ -14,8 +15,19 @@ install-job: # This job runs in the build stage, which runs first. paths: - Web/dist/Web/browser # The 'dist' directory will be available in the next stage. +semantic-release: + image: node:24 + stage: release + script: + - apt update && apt install zip -y + - zip -r dist.zip Web/dist/Web/browser + - npm install --save-dev @semantic-release/gitlab + - npx semantic-release --debug + only: + - main + deploy-job: # This job runs in the deploy stage. - stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + stage: release # It only runs when *both* jobs in the test stage complete successfully. environment: production tags: - deployment diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..2e59c70 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,20 @@ +{ + "branches": ["main"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/gitlab", + { + "gitlabUrl": "https://gitlab.lesko.me", + "verifyConditions": [ + "@semantic-release/gitlab" + ], + "assets": [ + { "path": "dist.zip", "label": "bundle" }, + { "url": "https://gitlab.lesko.me/marek/centrum/-/blob/main/README.md", "label": "README.md" } + ] + } + ] + ] +} \ No newline at end of file