diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb23307..19d1ab7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,23 +17,10 @@ services: - .shadow-cljs/ - .m2 before_script: + - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - npm install -.cljs-upload-job: &cljs-upload - image: domaindrivenarchitecture/shadow-cljs - cache: - key: ${CI_COMMIT_REF_SLUG} - paths: - - node_modules/ - before_script: - - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - - mkdir -p target/npm-build - - cp target/mastodon-bot.js target/npm-build/ - - cp target/mastodon-bot.js.sha256 target/npm-build/ - - cp target/mastodon-bot.js.sha512 target/npm-build/ - - cp README.md target/npm-build/ - -.clj-uploadjob: &clj-upload +.clj-uploadjob: &clj image: clojure:lein-2.7.1-alpine cache: key: ${CI_COMMIT_REF_SLUG} @@ -49,7 +36,7 @@ test-cljs: - shadow-cljs compile test test-clj: - <<: *clj-upload + <<: *clj stage: build_and_test script: - lein test @@ -68,15 +55,16 @@ package: <<: *cljs stage: package script: + - mkdir -p target/npm-build - shadow-cljs release app - - chmod a+x target/mastodon-bot.js - - sha256sum target/mastodon-bot.js > target/mastodon-bot.js.sha256 - - sha512sum target/mastodon-bot.js > target/mastodon-bot.js.sha512 + - cp README.md target/npm-build/ + - cp package.json target/npm-build/ + - chmod a+x target/npm-build/mastodon-bot.js + - sha256sum target/npm-build/mastodon-bot.js > target/npm-build/mastodon-bot.js.sha256 + - sha512sum targetnpm-build//mastodon-bot.js > target/npm-build/mastodon-bot.js.sha512 artifacts: paths: - - target/mastodon-bot.js - - target/mastodon-bot.js.sha256 - - target/mastodon-bot.js.sha512 + - target/npm-build sast: variables: @@ -90,17 +78,16 @@ include: - template: Security/SAST.gitlab-ci.yml upload-cljs-prerelease: - <<: *cljs-upload + <<: *cljs stage: upload rules: - if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null' script: - - cp package.json target/npm-build/ - sed -i 's|SNAPSHOT|'$(date +"%Y%m%d%H%M%S")'|' ./target/npm-build/package.json - npm publish ./target/npm-build --access public upload-clj-prerelease: - <<: *clj-upload + <<: *clj stage: upload rules: - if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null' @@ -108,12 +95,11 @@ upload-clj-prerelease: - lein deploy clojars upload-cljs-release: - <<: *cljs-upload + <<: *cljs stage: upload rules: - if: '$CI_COMMIT_TAG != null' script: - - cp package.json target/npm-build/ - npm publish ./target/npm-build --access public image-test-publish: