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