From 9bfb492488e0fd000e3dc257f7bdb9a4a6449f4b Mon Sep 17 00:00:00 2001 From: jem Date: Wed, 10 Feb 2021 13:03:38 +0100 Subject: [PATCH] add package & upload --- .gitlab-ci.yml | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 910cdf5..47316ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,16 +2,48 @@ image: node:lts-buster stages: - test - - build + - package + - upload cache: + key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ +default: + before_script: + - apt update && apt -qqy install openjdk-11-jre-headless + - echo _auth=$NPM_PUBLSH_KEY >> .npmrc + - echo email=$NPM_PUBLSH_MAIL >> .npmrc + - echo always-auth=true >> .npmrc + - npm install + - npm install -g --save-dev shadow-cljs + build: stage: test - script: - - apt update && apt -qqy install openjdk-11-jre-headless - - npm install - - npm install -g --save-dev shadow-cljs + script: - shadow-cljs compile test + +package: + stage: package + artifacts: + paths: + - target/ + script: + - shadow-cljs compile app + - chmod a+x mastodon-bot.js + - sha256sum mastodon-bot.js > target/mastodon-bot.js.sha256 + - sha512sum mastodon-bot.js > target/mastodon-bot.js.sha512 + +upload: + stage: upload + script: + - mkdir -p target/npm-build/mastodon_bot + - cp mastodon-bot.js target/npm-build/mastodon_bot/ + - cp target/mastodon-bot.js.sha256 target/npm-build/mastodon_bot/ + - cp target/mastodon-bot.js.sha512 target/npm-build/mastodon_bot/ + - cp package.json target/npm-build/mastodon_bot/ + - cp README.md target/npm-build/mastodon_bot/ + - #npm version --no-git-tag-version $(npm view @latest version) + - #npm version --no-git-tag-version prerelease + - npm publish ./target/npm-build/mastodon_bot --access public