c4k-common/.gitlab-ci.yml
2021-07-09 19:30:40 +02:00

74 lines
1.5 KiB
YAML

stages:
- build_and_test
- package
- security
- upload
.cljs-job: &cljs
image: domaindrivenarchitecture/shadow-cljs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
- .shadow-cljs/
- .m2
before_script:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm install
.clj-job: &clj
image: domaindrivenarchitecture/lein
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .m2
before_script:
- mkdir -p /root/.lein
- echo "{:auth {:repository-auth {#\"clojars\" {:username \"${CLOJARS_USER}\" :password \"${CLOJARS_TOKEN_DOMAINDRIVENARCHITECTURE}\" }}}}" > ~/.lein/profiles.clj
test-clj:
<<: *clj
stage: build_and_test
script:
- lein test
test-cljs:
<<: *cljs
stage: build_and_test
script:
- shadow-cljs compile test
.upload-clj-prerelease:
<<: *clj
stage: upload
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null'
script:
- lein deploy clojars
.upload-cljs-prerelease:
<<: *clj
stage: upload
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null'
script:
- mv project.clj project-clj.clj && mv project-cljs.clj project.clj
- lein deploy clojars
upload-clj-release:
<<: *clj
stage: upload
rules:
- if: '$CI_COMMIT_TAG != null'
script:
- lein deploy clojars
upload-cljs-release:
<<: *clj
stage: upload
rules:
- if: '$CI_COMMIT_TAG != null'
script:
- mv project.clj project-clj.clj && mv project-cljs.clj project.clj
- lein deploy clojars