improved release mgm

master
jem 3 years ago
parent 684d471696
commit 2cbb3c20ba

@ -13,9 +13,6 @@ cache:
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
@ -35,8 +32,33 @@ package:
- sha256sum target/mastodon-bot.js > target/mastodon-bot.js.sha256
- sha512sum target/mastodon-bot.js > target/mastodon-bot.js.sha512
upload:
upload-prerelease:
stage: upload
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == ""'
before_script:
- echo _auth=$NPM_PUBLSH_KEY >> .npmrc
- echo email=$NPM_PUBLSH_MAIL >> .npmrc
- echo always-auth=true >> .npmrc
script:
- mkdir -p target/npm-build/mastodon_bot
- cp target/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 prerelease
- npm publish ./target/npm-build/mastodon_bot --access public
upload-release:
stage: upload
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG != ""'
before_script:
- echo _auth=$NPM_PUBLSH_KEY >> .npmrc
- echo email=$NPM_PUBLSH_MAIL >> .npmrc
- echo always-auth=true >> .npmrc
script:
- mkdir -p target/npm-build/mastodon_bot
- cp target/mastodon-bot.js target/npm-build/mastodon_bot/
@ -44,6 +66,5 @@ upload:
- 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 <yourProject>@latest version)
#- npm version --no-git-tag-version prerelease
- npm version --no-git-tag-version $CI_COMMIT_TAG
- npm publish ./target/npm-build/mastodon_bot --access public