This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-25
Channels
- # anglican (2)
- # babashka (53)
- # beginners (99)
- # brompton (1)
- # calva (28)
- # circleci (43)
- # clj-commons (4)
- # clj-kondo (176)
- # cljsrn (22)
- # clojars (7)
- # clojure (175)
- # clojure-australia (2)
- # clojure-europe (20)
- # clojure-germany (1)
- # clojure-uk (5)
- # clojurescript (195)
- # cursive (18)
- # datomic (13)
- # emacs (2)
- # farolero (9)
- # find-my-lib (6)
- # fulcro (8)
- # graalvm (12)
- # gratitude (5)
- # helix (11)
- # improve-getting-started (36)
- # introduce-yourself (3)
- # jackdaw (21)
- # jobs (2)
- # joker (2)
- # malli (65)
- # meander (24)
- # nbb (2)
- # off-topic (4)
- # pathom (2)
- # polylith (17)
- # portal (5)
- # react (3)
- # reagent (22)
- # releases (1)
- # ring (4)
- # shadow-cljs (79)
- # show-and-tell (2)
- # testing (5)
- # tools-deps (9)
- # xtdb (12)
I was following this bit of documentation, but I was fooled by the lower case letter in the environment variable $npm_TOKEN
which should probably be capital letters:
https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/
I have some trouble building certain jobs only when I pushed a tag:
workflows:
version: 2
ci:
jobs:
- test:
filters:
tags:
only: /.*/
- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
(e.g. here: https://app.circleci.com/pipelines/github/borkdude/nbb/20/workflows/6ac1b355-0b99-4ec5-8e68-00a535f84f86/jobs/27)
The example at "Git Tag Job Execution - Deploy on tagged commit" here, also seems wrong: https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/
ffffffff.... how am I going to test this without making a gazillion useless releases?
any ideas @lee @rahul080327 @slipset?
so what I'm doing, I'm executing this:
bump-version (do (shell "npm version patch")
(shell "git push --atomic origin main"
(str "v" (:version (json/parse-string (slurp "package.json") true)))))
and then circleci should always execute the test job + only the deploy job in case of such a tag
I've been mostly in GitHub Actions these days... Do I remember @slipset generalizing circleci tag based deploy support for clj-commons though?
This is the config I currently have:
workflows:
version: 2
ci:
jobs:
- test
- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
Here is an example @slipset gave some time ago: https://github.com/clj-commons/fs/blob/master/.circleci/config.yml
I've read several forum entries about this too, it doesn't make sense to me today. Maybe I should just try github actions for this
hmmm, it seems this is working now:
workflows:
ci:
jobs:
- test:
filters:
tags:
only: /.*/
- deploy:
requires:
- test
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
These rules are evaluated top-down to work out if a job should be included or excluded
If a tag is pushed:
• and the push did not push a branch
• and there is a tags: only
filter
• and the tag matches that filter
then the job will be included in the workflow.
If a tag is pushed:
• and the push did not push a branch
• and there is a tags: ignore
filter
• and the tag does not match that filter
then the job will be included in the workflow.
If a tag is pushed:
• and the push did not push a branch
then the job will be removed from the workflow.
If a tag is pushed:
• and the push also pushed a branch
• and there is a branches: only
filter
• and the branch matches that filter
then the job will be included in the workflow.
If a tag is pushed:
• and the push also pushed a branch
• and there is a branches: ignore
filter
• and the branch name does not match that filter
then the job will be included in the workflow
If a tag is pushed:
• and the push also pushed a branch
• and there is a tags: ignore
filter
• and the tag does not match that filter
then the job will be included in the workflow
If a tag is pushed:
• and the push also pushed a branch
then the job will be included in the workflow
I think I'll just not use any of this filter stuff and just check programmatically what the current tag is
For rewrite-clj on GHA, I took the approach of https://github.com/clj-commons/rewrite-clj/blob/main/doc/04-maintainer-guide.adoc#releasing. Not sure if this concept works for circleci or for your versioning scheme.
I'm taking the bb tasks approach here which runs npm version which creates a git tag which is then pushed atomically with the new commit
ok, all fixed now using programming instead of config DSL: https://github.com/borkdude/nbb/blob/cc06810b06e703c60ba9751b3cb430407140d469/bb.edn#L60
@glenjamin the npm credentials? that wasn't the problem, the problem was that the filters didn't work for me, but I figured it out a different way
Sorry, I should have been clearer: I was asking for a different reason. have you got it set so that untrusted builds can access those creds? The config file alone isn’t enough to protect credentials
These rules are evaluated top-down to work out if a job should be included or excluded
If a tag is pushed:
• and the push did not push a branch
• and there is a tags: only
filter
• and the tag matches that filter
then the job will be included in the workflow.
If a tag is pushed:
• and the push did not push a branch
• and there is a tags: ignore
filter
• and the tag does not match that filter
then the job will be included in the workflow.
If a tag is pushed:
• and the push did not push a branch
then the job will be removed from the workflow.
If a tag is pushed:
• and the push also pushed a branch
• and there is a branches: only
filter
• and the branch matches that filter
then the job will be included in the workflow.
If a tag is pushed:
• and the push also pushed a branch
• and there is a branches: ignore
filter
• and the branch name does not match that filter
then the job will be included in the workflow
If a tag is pushed:
• and the push also pushed a branch
• and there is a tags: ignore
filter
• and the tag does not match that filter
then the job will be included in the workflow
If a tag is pushed:
• and the push also pushed a branch
then the job will be included in the workflow