release process should work
This commit is contained in:
parent
187611342c
commit
9138ba5764
5 changed files with 67 additions and 23 deletions
|
@ -5,24 +5,24 @@ stages:
|
|||
- upload
|
||||
|
||||
.cljs-job: &cljs
|
||||
image: node:lts-buster
|
||||
image: domaindrivenarchitecture/shadow-cljs
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- node_modules/
|
||||
- .shadow-cljs/
|
||||
- .m2
|
||||
before_script:
|
||||
- apt update && apt -qqy install openjdk-11-jre-headless
|
||||
- npm install
|
||||
- npm install -g shadow-cljs
|
||||
|
||||
.js-job: &js-upload
|
||||
image: node:lts-buster
|
||||
.cljs-upload-job: &cljs-upload
|
||||
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
|
||||
- mkdir -p target/npm-build
|
||||
|
@ -31,18 +31,26 @@ stages:
|
|||
- cp target/k8s-mastodon-bot.js.sha512 target/npm-build/
|
||||
- cp README.md target/npm-build/
|
||||
|
||||
.clj-uploadjob: &clj-upload
|
||||
image: clojure:lein-2.7.1-alpine
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- .m2
|
||||
before_script:
|
||||
- echo "{:auth {:repository-auth {#\"clojars\" {:username \"${CLOJARS_USER}\" :password \"${CLOJARS_PASSWORD}\" }}}}" > ~/.lein/profiles.clj
|
||||
|
||||
build_and_test:
|
||||
<<: *cljs
|
||||
stage: build_and_test
|
||||
script:
|
||||
- shadow-cljs compile test
|
||||
|
||||
#activate as soon as https://github.com/thheller/shadow-cljs/issues/843 is implemented
|
||||
.report:
|
||||
report:
|
||||
<<: *cljs
|
||||
stage: build_and_test
|
||||
script:
|
||||
- shadow-cljs run shadow.cljs.build-report app target/build-report.html
|
||||
- shadow-cljs run shadow.cljs.build-report frontend target/build-report.html
|
||||
artifacts:
|
||||
paths:
|
||||
- target/build-report.html
|
||||
|
@ -51,7 +59,7 @@ package:
|
|||
<<: *cljs
|
||||
stage: package
|
||||
script:
|
||||
- shadow-cljs compile app
|
||||
- shadow-cljs release app
|
||||
- chmod a+x target/k8s-mastodon-bot.js
|
||||
- sha256sum target/k8s-mastodon-bot.js > target/k8s-mastodon-bot.js.sha256
|
||||
- sha512sum target/k8s-mastodon-bot.js > target/k8s-mastodon-bot.js.sha512
|
||||
|
@ -72,23 +80,29 @@ sast:
|
|||
include:
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
upload-prerelease:
|
||||
<<: *js-upload
|
||||
upload-cljs-prerelease:
|
||||
<<: *cljs-upload
|
||||
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
|
||||
# unsure wether that's a good idea to bump versions from ci.
|
||||
#- npm version prerelease -m "[skip-ci] version bump prerelease version"
|
||||
#- git push
|
||||
|
||||
upload-release:
|
||||
<<: *js-upload
|
||||
upload-clj-prerelease:
|
||||
<<: *clj-upload
|
||||
stage: upload
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG != null'
|
||||
- if: '$CI_COMMIT_BRANCH == "master" && $CI_COMMIT_TAG == null'
|
||||
script:
|
||||
- lein deploy clojars
|
||||
|
||||
upload-cljs-release:
|
||||
<<: *cljs-upload
|
||||
stage: upload
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
script:
|
||||
- cp package.json target/npm-build/
|
||||
- npm publish ./target/npm-build --access public
|
||||
|
|
|
@ -14,6 +14,12 @@ npm install --ignore-scripts
|
|||
npx shadow-cljs compile test
|
||||
```
|
||||
|
||||
## create frontend script
|
||||
|
||||
```
|
||||
npx shadow-cljs release frontend
|
||||
```
|
||||
|
||||
## install kubectl
|
||||
|
||||
```
|
||||
|
|
13
doc/Releasing.md
Normal file
13
doc/Releasing.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# stable release (should be done from master)
|
||||
|
||||
```
|
||||
#adjust [version]
|
||||
vi package.json
|
||||
|
||||
lein release
|
||||
|
||||
# bump version - increase version and add -SNAPSHOT
|
||||
vi package.json
|
||||
git commit -am "version bump"
|
||||
git push
|
||||
```
|
16
project.clj
16
project.clj
|
@ -3,10 +3,12 @@
|
|||
:url "https://www.domaindrivenarchitecture.org"
|
||||
:license {:name "Apache License, Version 2.0"
|
||||
:url "https://www.apache.org/licenses/LICENSE-2.0.html"}
|
||||
:dependencies [[org.clojure/clojure "1.10.0"]
|
||||
:dependencies [[org.clojure/clojure "1.10.3"]
|
||||
[aero "1.1.6"]
|
||||
[orchestra "2021.01.01-1"]
|
||||
[expound "0.8.9"]
|
||||
[clj-commons/clj-yaml "0.7.106"]]
|
||||
[clj-commons/clj-yaml "0.7.106"]
|
||||
[dda/mastodon-bot "1.10.10-SNAPSHOT"]]
|
||||
:source-paths ["src/main/cljc"
|
||||
"src/main/clj"]
|
||||
:resource-paths ["src/main/resources"]
|
||||
|
@ -20,6 +22,12 @@
|
|||
:uberjar {:aot :all
|
||||
:main dda.k8s-mastodon-bot.uberjar
|
||||
:uberjar-name "k8s-mastodon-bot-standalone.jar"
|
||||
:dependencies [[org.clojure/tools.cli "1.0.194"]
|
||||
:dependencies [[org.clojure/tools.cli "1.0.206"]
|
||||
[ch.qos.logback/logback-classic "1.3.0-alpha5"]
|
||||
[org.slf4j/jcl-over-slf4j "2.0.0-alpha1"]]}})
|
||||
[org.slf4j/jcl-over-slf4j "2.0.0-alpha1"]]}}
|
||||
:release-tasks [["vcs" "assert-committed"]
|
||||
["change" "version" "leiningen.release/bump-version" "release"]
|
||||
["vcs" "commit"]
|
||||
["vcs" "tag"]
|
||||
["deploy"]
|
||||
["change" "version" "leiningen.release/bump-version"]])
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
"src/main/resources"
|
||||
"src/test/cljc"]
|
||||
:dependencies [[aero "1.1.6"]
|
||||
[expound "0.8.4"]]
|
||||
[orchestra "2021.01.01-1"]
|
||||
[expound "0.8.9"]
|
||||
[dda/mastodon-bot "1.10.10-SNAPSHOT"]]
|
||||
:dev-http {8080 "public"}
|
||||
:builds {:frontend {:target :browser
|
||||
:modules {:main {:init-fn dda.k8s-mastodon-bot.browser/init}}
|
||||
:release {}}
|
||||
:release {}
|
||||
:compiler-options {:optimizations :advanced}}
|
||||
:app {:target :node-script
|
||||
:output-to "target/k8s-mastodon-bot.js"
|
||||
:main dda.k8s-mastodon-bot.core/main
|
||||
|
|
Loading…
Reference in a new issue