This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
caldwell-59/.gitlab-ci.yml
2024-10-27 12:49:59 +00:00

68 lines
1.2 KiB
YAML

stages:
- test
- build
- release
cache: &global_cache
key:
files:
- package.json
- yarn.lock
paths:
- node_modules
policy: pull-push
test:
image: node:20
stage: test
cache:
<<: *global_cache
before_script:
- yarn
script:
- yarn test
except:
- tags
build:
image: node:20
stage: build
cache:
<<: *global_cache
before_script:
- yarn
script:
- yarn zip
after_script:
- echo "JOB_ID=$CI_JOB_ID" >> job.env
artifacts:
paths:
- dist/caldwell-59.zip
expire_in: 1d
reports:
dotenv: job.env
except:
- tags
release:
image: registry.gitlab.com/gitlab-org/release-cli
stage: release
cache:
<<: *global_cache
needs:
- job: build
artifacts: true
script:
- echo "Create Release $CI_COMMIT_SHA"
release:
name: "Release $CI_COMMIT_SHA"
tag_name: "release-$CI_COMMIT_SHA"
ref: "$CI_COMMIT_SHA"
description: "Release $CI_COMMIT_SHA"
assets:
links:
- name: "caldwell-59.zip"
url: "https://git.karaolidis.com/karaolidis/caldwell-59/-/jobs/$JOB_ID/artifacts/raw/dist/caldwell-59.zip"
except:
- tags